Added payroll persistance and updated Talent Acquisition role
<SRS> SRS02 : Employee Management </SRS> <Changes> - Added Payroll getHeaders, serialize and deserialize functions - Stored payrolls in DataStore - Loaded and saved payrolls along with employees - Linked payroll to employees during creation and load - Added employeeId to Payroll - Renamed TAG role to TALENT_ACQUISITION across the project - Added missing TalentExecutive case in Employee deserialization - Added constructor to TalentExecutive for FileManager integration - Renamed ID counters to m_uid for consistency - Updated salary values in ApplicationConfig </Changes> <Review> Smitha Mohan </Review>
This commit is contained in:
@@ -50,9 +50,11 @@ Employees ZenvyController::getEmployees()
|
|||||||
void ZenvyController::loadStates()
|
void ZenvyController::loadStates()
|
||||||
{
|
{
|
||||||
m_employeeManagementService->loadEmployees();
|
m_employeeManagementService->loadEmployees();
|
||||||
|
m_payslipManagementService->loadPayrolls();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ZenvyController::persistStates()
|
void ZenvyController::persistStates()
|
||||||
{
|
{
|
||||||
m_employeeManagementService->saveEmployees();
|
m_employeeManagementService->saveEmployees();
|
||||||
|
m_payslipManagementService->savePayrolls();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,4 +27,7 @@ employeeMap& DataStore::getEmployees()
|
|||||||
return m_employees;
|
return m_employees;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
payrollMap& DataStore::getPayrolls()
|
||||||
|
{
|
||||||
|
return m_payrolls;
|
||||||
|
}
|
||||||
|
|||||||
@@ -18,8 +18,10 @@
|
|||||||
#include "Notification.h"
|
#include "Notification.h"
|
||||||
#include "Announcement.h"
|
#include "Announcement.h"
|
||||||
#include "Faq.h"
|
#include "Faq.h"
|
||||||
|
#include "Payroll.h"
|
||||||
|
|
||||||
using employeeMap = std::map<std::string, std::shared_ptr<Employee>>;
|
using employeeMap = std::map<std::string, std::shared_ptr<Employee>>;
|
||||||
|
using payrollMap = std::map<std::string, std::shared_ptr<Payroll>>;
|
||||||
using logMap = std::map<util::Timestamp, std::shared_ptr<Log>>;
|
using logMap = std::map<util::Timestamp, std::shared_ptr<Log>>;
|
||||||
|
|
||||||
class DataStore
|
class DataStore
|
||||||
@@ -27,6 +29,7 @@ class DataStore
|
|||||||
private:
|
private:
|
||||||
std::shared_ptr<Employee> m_authenticatedEmployee;
|
std::shared_ptr<Employee> m_authenticatedEmployee;
|
||||||
employeeMap m_employees;
|
employeeMap m_employees;
|
||||||
|
payrollMap m_payrolls;
|
||||||
logMap m_logs;
|
logMap m_logs;
|
||||||
DataStore() = default;
|
DataStore() = default;
|
||||||
public:
|
public:
|
||||||
@@ -36,6 +39,7 @@ public:
|
|||||||
DataStore(DataStore&&) = delete;
|
DataStore(DataStore&&) = delete;
|
||||||
DataStore& operator=(DataStore&&) = delete;
|
DataStore& operator=(DataStore&&) = delete;
|
||||||
employeeMap& getEmployees();
|
employeeMap& getEmployees();
|
||||||
|
payrollMap& getPayrolls();
|
||||||
logMap& getLogs();
|
logMap& getLogs();
|
||||||
std::shared_ptr<Employee>& getAuthenticatedEmployee();
|
std::shared_ptr<Employee>& getAuthenticatedEmployee();
|
||||||
void setAuthenticatedEmployee(std::shared_ptr < Employee>);
|
void setAuthenticatedEmployee(std::shared_ptr < Employee>);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#include "Announcement.h"
|
#include "Announcement.h"
|
||||||
|
|
||||||
int Announcement::m_anid = 0;
|
int Announcement::m_uid = 0;
|
||||||
|
|
||||||
const std::string& Announcement::getAnnouncementId() const
|
const std::string& Announcement::getAnnouncementId() const
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -5,14 +5,14 @@
|
|||||||
class Announcement
|
class Announcement
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
static int m_anid;
|
static int m_uid;
|
||||||
std::string m_id;
|
std::string m_id;
|
||||||
util::Timestamp m_timestamp;
|
util::Timestamp m_timestamp;
|
||||||
std::string m_message;
|
std::string m_message;
|
||||||
public:
|
public:
|
||||||
Announcement() : m_id("AN" + std::to_string(++m_anid)), m_timestamp(), m_message("") {}
|
Announcement() : m_id("AN" + std::to_string(++m_uid)), m_timestamp(), m_message("") {}
|
||||||
Announcement(const std::string& message)
|
Announcement(const std::string& message)
|
||||||
: m_id("AN" + std::to_string(++m_anid)), m_message(message) {}
|
: m_id("AN" + std::to_string(++m_uid)), m_message(message) {}
|
||||||
const std::string& getAnnouncementId() const;
|
const std::string& getAnnouncementId() const;
|
||||||
const util::Timestamp& getAnnouncementTimestamp() const;
|
const util::Timestamp& getAnnouncementTimestamp() const;
|
||||||
const std::string& getAnnouncementMessage() const;
|
const std::string& getAnnouncementMessage() const;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#include "Attendance.h"
|
#include "Attendance.h"
|
||||||
|
|
||||||
int Attendance::m_aid = 0;
|
int Attendance::m_uid = 0;
|
||||||
|
|
||||||
const std::string& Attendance::getAttendanceId() const
|
const std::string& Attendance::getAttendanceId() const
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -5,15 +5,15 @@
|
|||||||
class Attendance
|
class Attendance
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
static int m_aid;
|
static int m_uid;
|
||||||
std::string m_id;
|
std::string m_id;
|
||||||
util::Timestamp m_loginTime;
|
util::Timestamp m_loginTime;
|
||||||
util::Timestamp m_logoutTime;
|
util::Timestamp m_logoutTime;
|
||||||
public:
|
public:
|
||||||
Attendance() : m_id("AD" + std::to_string(++m_aid)), m_loginTime(), m_logoutTime() {}
|
Attendance() : m_id("AD" + std::to_string(++m_uid)), m_loginTime(), m_logoutTime() {}
|
||||||
Attendance(const util::Timestamp& loginTime,
|
Attendance(const util::Timestamp& loginTime,
|
||||||
const util::Timestamp& logoutTime)
|
const util::Timestamp& logoutTime)
|
||||||
: m_id("AD" + std::to_string(++m_aid)), m_loginTime(loginTime), m_logoutTime(logoutTime) {}
|
: m_id("AD" + std::to_string(++m_uid)), m_loginTime(loginTime), m_logoutTime(logoutTime) {}
|
||||||
const std::string& getAttendanceId() const;
|
const std::string& getAttendanceId() const;
|
||||||
const util::Timestamp& getLoginTime() const;
|
const util::Timestamp& getLoginTime() const;
|
||||||
const util::Timestamp& getLogoutTime() const;
|
const util::Timestamp& getLogoutTime() const;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#include "Booking.h"
|
#include "Booking.h"
|
||||||
|
|
||||||
int Booking::m_bid = 0;
|
int Booking::m_uid = 0;
|
||||||
|
|
||||||
const std::string& Booking::getBookingId() const
|
const std::string& Booking::getBookingId() const
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -7,19 +7,19 @@
|
|||||||
class Booking
|
class Booking
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
static int m_bid;
|
static int m_uid;
|
||||||
std::string m_id;
|
std::string m_id;
|
||||||
util::Timestamp m_startTime;
|
util::Timestamp m_startTime;
|
||||||
util::Timestamp m_endTime;
|
util::Timestamp m_endTime;
|
||||||
std::string m_employeeId;
|
std::string m_employeeId;
|
||||||
std::shared_ptr<Team> m_team;
|
std::shared_ptr<Team> m_team;
|
||||||
public:
|
public:
|
||||||
Booking() : m_id("BK" + std::to_string(++m_bid)), m_startTime(), m_endTime(), m_employeeId(""), m_team(nullptr) {}
|
Booking() : m_id("BK" + std::to_string(++m_uid)), m_startTime(), m_endTime(), m_employeeId(""), m_team(nullptr) {}
|
||||||
Booking(const util::Timestamp& startTime,
|
Booking(const util::Timestamp& startTime,
|
||||||
const util::Timestamp& endTime,
|
const util::Timestamp& endTime,
|
||||||
const std::string& employeeId,
|
const std::string& employeeId,
|
||||||
std::shared_ptr<Team> team)
|
std::shared_ptr<Team> team)
|
||||||
: m_id("BK" + std::to_string(++m_bid)), m_startTime(startTime), m_endTime(endTime), m_employeeId(employeeId), m_team(team) {}
|
: m_id("BK" + std::to_string(++m_uid)), m_startTime(startTime), m_endTime(endTime), m_employeeId(employeeId), m_team(team) {}
|
||||||
const std::string& getBookingId() const;
|
const std::string& getBookingId() const;
|
||||||
const util::Timestamp& getStartTime() const;
|
const util::Timestamp& getStartTime() const;
|
||||||
const util::Timestamp& getEndTime() const;
|
const util::Timestamp& getEndTime() const;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#include "Candidate.h"
|
#include "Candidate.h"
|
||||||
|
|
||||||
int Candidate::m_cid = 0;
|
int Candidate::m_uid = 0;
|
||||||
|
|
||||||
const std::string& Candidate::getCandidateId() const
|
const std::string& Candidate::getCandidateId() const
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -5,19 +5,19 @@
|
|||||||
class Candidate
|
class Candidate
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
static int m_cid;
|
static int m_uid;
|
||||||
std::string m_id;
|
std::string m_id;
|
||||||
std::string m_name;
|
std::string m_name;
|
||||||
long int m_phone;
|
long int m_phone;
|
||||||
std::string m_qualification;
|
std::string m_qualification;
|
||||||
Enums::CandidateStatus m_status;
|
Enums::CandidateStatus m_status;
|
||||||
public:
|
public:
|
||||||
Candidate() : m_id("CD" + std::to_string(++m_cid)), m_name(""), m_phone(0), m_qualification(""), m_status(Enums::CandidateStatus::PENDING) {}
|
Candidate() : m_id("CD" + std::to_string(++m_uid)), m_name(""), m_phone(0), m_qualification(""), m_status(Enums::CandidateStatus::PENDING) {}
|
||||||
Candidate(const std::string& name,
|
Candidate(const std::string& name,
|
||||||
long int phone,
|
long int phone,
|
||||||
const std::string& qualification,
|
const std::string& qualification,
|
||||||
Enums::CandidateStatus status)
|
Enums::CandidateStatus status)
|
||||||
: m_id("CD" + std::to_string(++m_cid)), m_name(name), m_phone(phone), m_qualification(qualification), m_status(status) {}
|
: m_id("CD" + std::to_string(++m_uid)), m_name(name), m_phone(phone), m_qualification(qualification), m_status(status) {}
|
||||||
const std::string& getCandidateId() const;
|
const std::string& getCandidateId() const;
|
||||||
const std::string& getCandidateName() const;
|
const std::string& getCandidateName() const;
|
||||||
long int getCandidatePhone() const;
|
long int getCandidatePhone() const;
|
||||||
|
|||||||
@@ -246,6 +246,17 @@ std::shared_ptr<Employee> Employee::deserialize(const std::string& record)
|
|||||||
teamStatus,
|
teamStatus,
|
||||||
accountStatus
|
accountStatus
|
||||||
);
|
);
|
||||||
|
case Enums::EmployeeType::TALENT_ACQUISITION:
|
||||||
|
return Factory::getObject<TalentExecutive>(
|
||||||
|
id,
|
||||||
|
name,
|
||||||
|
phone,
|
||||||
|
password,
|
||||||
|
email,
|
||||||
|
teamId,
|
||||||
|
teamStatus,
|
||||||
|
accountStatus
|
||||||
|
);
|
||||||
case Enums::EmployeeType::ADMIN:
|
case Enums::EmployeeType::ADMIN:
|
||||||
return Factory::getObject<Admin>(
|
return Factory::getObject<Admin>(
|
||||||
id,
|
id,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#include "JobListing.h"
|
#include "JobListing.h"
|
||||||
|
|
||||||
int JobListing::m_jid = 0;
|
int JobListing::m_uid = 0;
|
||||||
|
|
||||||
const std::string& JobListing::getJobId() const
|
const std::string& JobListing::getJobId() const
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ using candidateMap = std::map<std::string, std::shared_ptr<Candidate>>;
|
|||||||
class JobListing
|
class JobListing
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
static int m_jid;
|
static int m_uid;
|
||||||
std::string m_id;
|
std::string m_id;
|
||||||
std::string m_name;
|
std::string m_name;
|
||||||
std::string m_description;
|
std::string m_description;
|
||||||
@@ -17,13 +17,13 @@ private:
|
|||||||
int m_numberOfVacancies;
|
int m_numberOfVacancies;
|
||||||
candidateMap m_candidates;
|
candidateMap m_candidates;
|
||||||
public:
|
public:
|
||||||
JobListing() : m_id("JL" + std::to_string(++m_jid)), m_name(""), m_description(""), m_status(Enums::JobListingStatus::CLOSED), m_numberOfVacancies(0) {}
|
JobListing() : m_id("JL" + std::to_string(++m_uid)), m_name(""), m_description(""), m_status(Enums::JobListingStatus::CLOSED), m_numberOfVacancies(0) {}
|
||||||
JobListing(const std::string& name,
|
JobListing(const std::string& name,
|
||||||
const std::string& description,
|
const std::string& description,
|
||||||
Enums::JobListingStatus status,
|
Enums::JobListingStatus status,
|
||||||
int numberOfVacancies,
|
int numberOfVacancies,
|
||||||
const candidateMap& candidates)
|
const candidateMap& candidates)
|
||||||
: m_id("JL" + std::to_string(++m_jid)), m_name(name), m_description(description), m_status(status), m_numberOfVacancies(numberOfVacancies), m_candidates(candidates) {}
|
: m_id("JL" + std::to_string(++m_uid)), m_name(name), m_description(description), m_status(status), m_numberOfVacancies(numberOfVacancies), m_candidates(candidates) {}
|
||||||
const std::string& getJobId() const;
|
const std::string& getJobId() const;
|
||||||
const std::string& getJobName() const;
|
const std::string& getJobName() const;
|
||||||
const std::string& getJobDescription() const;
|
const std::string& getJobDescription() const;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#include "Leave.h"
|
#include "Leave.h"
|
||||||
|
|
||||||
int Leave::m_lid = 0;
|
int Leave::m_uid = 0;
|
||||||
|
|
||||||
const std::string& Leave::getLeaveId() const
|
const std::string& Leave::getLeaveId() const
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
class Leave
|
class Leave
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
static int m_lid;
|
static int m_uid;
|
||||||
std::string m_id;
|
std::string m_id;
|
||||||
std::string m_employeeId;
|
std::string m_employeeId;
|
||||||
util::Timestamp m_timestamp;
|
util::Timestamp m_timestamp;
|
||||||
@@ -16,12 +16,12 @@ private:
|
|||||||
static int m_numberOfMedicalLeave;
|
static int m_numberOfMedicalLeave;
|
||||||
Enums::LeaveType m_leaveType;
|
Enums::LeaveType m_leaveType;
|
||||||
public:
|
public:
|
||||||
Leave() : m_id("LV" + std::to_string(++m_lid)), m_employeeId(""), m_timestamp(), m_reason(""), m_leaveType(Enums::LeaveType::GENERAL) {}
|
Leave() : m_id("LV" + std::to_string(++m_uid)), m_employeeId(""), m_timestamp(), m_reason(""), m_leaveType(Enums::LeaveType::GENERAL) {}
|
||||||
Leave(const std::string& employeeId,
|
Leave(const std::string& employeeId,
|
||||||
const util::Timestamp& timestamp,
|
const util::Timestamp& timestamp,
|
||||||
const std::string& reason,
|
const std::string& reason,
|
||||||
Enums::LeaveType leaveType)
|
Enums::LeaveType leaveType)
|
||||||
: m_id("LV" + std::to_string(++m_lid)), m_employeeId(employeeId), m_timestamp(timestamp), m_reason(reason), m_leaveType(leaveType) {}
|
: m_id("LV" + std::to_string(++m_uid)), m_employeeId(employeeId), m_timestamp(timestamp), m_reason(reason), m_leaveType(leaveType) {}
|
||||||
const std::string& getLeaveId() const;
|
const std::string& getLeaveId() const;
|
||||||
const std::string& getEmployeeId() const;
|
const std::string& getEmployeeId() const;
|
||||||
const util::Timestamp& getTimestamp() const;
|
const util::Timestamp& getTimestamp() const;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#include "Notification.h"
|
#include "Notification.h"
|
||||||
|
|
||||||
int Notification::m_nid = 0;
|
int Notification::m_uid = 0;
|
||||||
|
|
||||||
const std::string& Notification::getNotificationId() const
|
const std::string& Notification::getNotificationId() const
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6,18 +6,18 @@
|
|||||||
class Notification
|
class Notification
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
static int m_nid;
|
static int m_uid;
|
||||||
std::string m_id;
|
std::string m_id;
|
||||||
std::string m_employeeId;
|
std::string m_employeeId;
|
||||||
std::string m_message;
|
std::string m_message;
|
||||||
util::Timestamp m_timestamp;
|
util::Timestamp m_timestamp;
|
||||||
Enums::NotificationStatus m_notificationStatus;
|
Enums::NotificationStatus m_notificationStatus;
|
||||||
public:
|
public:
|
||||||
Notification() : m_id("NF" + std::to_string(++m_nid)), m_employeeId(""), m_message(""), m_timestamp(), m_notificationStatus(Enums::NotificationStatus::UNREAD) {}
|
Notification() : m_id("NF" + std::to_string(++m_uid)), m_employeeId(""), m_message(""), m_timestamp(), m_notificationStatus(Enums::NotificationStatus::UNREAD) {}
|
||||||
Notification(const std::string& employeeId,
|
Notification(const std::string& employeeId,
|
||||||
const std::string& message,
|
const std::string& message,
|
||||||
Enums::NotificationStatus notificationStatus)
|
Enums::NotificationStatus notificationStatus)
|
||||||
: m_id("NF" + std::to_string(++m_nid)), m_employeeId(employeeId), m_message(message), m_notificationStatus(notificationStatus) {}
|
: m_id("NF" + std::to_string(++m_uid)), m_employeeId(employeeId), m_message(message), m_notificationStatus(notificationStatus) {}
|
||||||
const std::string& getNotificationId() const;
|
const std::string& getNotificationId() const;
|
||||||
const std::string& getEmployeeId() const;
|
const std::string& getEmployeeId() const;
|
||||||
const std::string& getNotificationMessage() const;
|
const std::string& getNotificationMessage() const;
|
||||||
|
|||||||
@@ -1,12 +1,48 @@
|
|||||||
|
#include <sstream>
|
||||||
|
#include <stdexcept>
|
||||||
#include "Payroll.h"
|
#include "Payroll.h"
|
||||||
|
#include "StringHelper.h"
|
||||||
|
#include "Factory.h"
|
||||||
|
|
||||||
int Payroll::m_prid = 0;
|
int Payroll::m_uid = 0;
|
||||||
|
|
||||||
const std::string& Payroll::getPayrollId() const
|
Payroll::Payroll(const std::string& id,
|
||||||
|
const std::string& employeeId,
|
||||||
|
double basicSalary,
|
||||||
|
double houseRentAllowance,
|
||||||
|
double foodAllowance,
|
||||||
|
double employeePFContribution,
|
||||||
|
double employerPFContribution)
|
||||||
|
: m_id("PR" + std::to_string(++m_uid)),
|
||||||
|
m_employeeId(employeeId),
|
||||||
|
m_basicSalary(basicSalary),
|
||||||
|
m_houseRentAllowance(houseRentAllowance),
|
||||||
|
m_foodAllowance(foodAllowance),
|
||||||
|
m_employeePFContribution(employeePFContribution),
|
||||||
|
m_employerPFContribution(employerPFContribution)
|
||||||
|
{
|
||||||
|
int idNumber = util::extractNumber(m_id);
|
||||||
|
if (idNumber > m_uid)
|
||||||
|
{
|
||||||
|
m_uid = idNumber;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const std::string& Payroll::getId() const
|
||||||
{
|
{
|
||||||
return m_id;
|
return m_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const std::string& Payroll::getEmployeeId() const
|
||||||
|
{
|
||||||
|
return m_employeeId;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Payroll::setEmployeeId(const std::string& employeeId)
|
||||||
|
{
|
||||||
|
m_employeeId = employeeId;
|
||||||
|
}
|
||||||
|
|
||||||
double Payroll::getBasicSalary() const
|
double Payroll::getBasicSalary() const
|
||||||
{
|
{
|
||||||
return m_basicSalary;
|
return m_basicSalary;
|
||||||
@@ -56,3 +92,57 @@ void Payroll::setEmployerPFContribution(double value)
|
|||||||
{
|
{
|
||||||
m_employerPFContribution = value;
|
m_employerPFContribution = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string Payroll::serialize() const
|
||||||
|
{
|
||||||
|
std::ostringstream serializedPayroll;
|
||||||
|
serializedPayroll << m_id << ','
|
||||||
|
<< m_employeeId << ','
|
||||||
|
<< m_basicSalary << ','
|
||||||
|
<< m_houseRentAllowance << ','
|
||||||
|
<< m_foodAllowance << ','
|
||||||
|
<< m_employeePFContribution << ','
|
||||||
|
<< m_employerPFContribution;
|
||||||
|
return serializedPayroll.str();
|
||||||
|
}
|
||||||
|
|
||||||
|
std::shared_ptr<Payroll> Payroll::deserialize(const std::string& record)
|
||||||
|
{
|
||||||
|
std::string id, employeeId;
|
||||||
|
std::string basicSalaryStr, houseRentAllowanceString, foodAllowanceString, employeePFString, employerPFString;
|
||||||
|
std::istringstream serializedPayroll(record);
|
||||||
|
std::getline(serializedPayroll, id, ',');
|
||||||
|
std::getline(serializedPayroll, employeeId, ',');
|
||||||
|
std::getline(serializedPayroll, basicSalaryStr, ',');
|
||||||
|
std::getline(serializedPayroll, houseRentAllowanceString, ',');
|
||||||
|
std::getline(serializedPayroll, foodAllowanceString, ',');
|
||||||
|
std::getline(serializedPayroll, employeePFString, ',');
|
||||||
|
std::getline(serializedPayroll, employerPFString, ',');
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
double basicSalary = std::stod(basicSalaryStr);
|
||||||
|
double houseRentAllowance = std::stod(houseRentAllowanceString);
|
||||||
|
double foodAllowance = std::stod(foodAllowanceString);
|
||||||
|
double employeePFContribution = std::stod(employeePFString);
|
||||||
|
double employerPFContribution = std::stod(employerPFString);
|
||||||
|
return Factory::getObject<Payroll>(
|
||||||
|
id,
|
||||||
|
employeeId,
|
||||||
|
basicSalary,
|
||||||
|
houseRentAllowance,
|
||||||
|
foodAllowance,
|
||||||
|
employeePFContribution,
|
||||||
|
employerPFContribution
|
||||||
|
);
|
||||||
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
throw std::runtime_error("Failed to deserialize Payroll object");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string Payroll::getHeaders()
|
||||||
|
{
|
||||||
|
return "PayrollId,EmployeeId,BasicSalary,HouseRentAllowance,FoodAllowance,EmployeePFContribution,EmployerPFContribution";
|
||||||
|
}
|
||||||
@@ -1,25 +1,47 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
class Payroll
|
class Payroll
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
static int m_prid;
|
static int m_uid;
|
||||||
std::string m_id;
|
std::string m_id;
|
||||||
|
std::string m_employeeId;
|
||||||
double m_basicSalary;
|
double m_basicSalary;
|
||||||
double m_houseRentAllowance;
|
double m_houseRentAllowance;
|
||||||
double m_foodAllowance;
|
double m_foodAllowance;
|
||||||
double m_employeePFContribution;
|
double m_employeePFContribution;
|
||||||
double m_employerPFContribution;
|
double m_employerPFContribution;
|
||||||
public:
|
public:
|
||||||
Payroll() : m_id("PR" + std::to_string(++m_prid)), m_basicSalary(0.0), m_houseRentAllowance(0.0), m_foodAllowance(0.0), m_employeePFContribution(0.0), m_employerPFContribution(0.0) {}
|
Payroll()
|
||||||
|
: m_id("PR" + std::to_string(++m_uid)),
|
||||||
|
m_basicSalary(0.0),
|
||||||
|
m_houseRentAllowance(0.0),
|
||||||
|
m_foodAllowance(0.0),
|
||||||
|
m_employeePFContribution(0.0),
|
||||||
|
m_employerPFContribution(0.0) {}
|
||||||
Payroll(double basicSalary,
|
Payroll(double basicSalary,
|
||||||
double houseRentAllowance,
|
double houseRentAllowance,
|
||||||
double foodAllowance,
|
double foodAllowance,
|
||||||
double employeePFContribution,
|
double employeePFContribution,
|
||||||
double employerPFContribution)
|
double employerPFContribution)
|
||||||
: m_id("PR" + std::to_string(++m_prid)), m_basicSalary(basicSalary), m_houseRentAllowance(houseRentAllowance), m_foodAllowance(foodAllowance), m_employeePFContribution(employeePFContribution), m_employerPFContribution(employerPFContribution) {}
|
: m_id("PR" + std::to_string(++m_uid)),
|
||||||
const std::string& getPayrollId() const;
|
m_basicSalary(basicSalary),
|
||||||
|
m_houseRentAllowance(houseRentAllowance),
|
||||||
|
m_foodAllowance(foodAllowance),
|
||||||
|
m_employeePFContribution(employeePFContribution),
|
||||||
|
m_employerPFContribution(employerPFContribution) {}
|
||||||
|
Payroll(const std::string& id,
|
||||||
|
const std::string& employeeId,
|
||||||
|
double basicSalary,
|
||||||
|
double houseRentAllowance,
|
||||||
|
double foodAllowance,
|
||||||
|
double employeePFContribution,
|
||||||
|
double employerPFContribution);
|
||||||
|
const std::string& getId() const;
|
||||||
|
const std::string& getEmployeeId() const;
|
||||||
|
void setEmployeeId(const std::string&);
|
||||||
double getBasicSalary() const;
|
double getBasicSalary() const;
|
||||||
double getHouseRentAllowance() const;
|
double getHouseRentAllowance() const;
|
||||||
double getFoodAllowance() const;
|
double getFoodAllowance() const;
|
||||||
@@ -30,4 +52,7 @@ public:
|
|||||||
void setFoodAllowance(double);
|
void setFoodAllowance(double);
|
||||||
void setEmployeePFContribution(double);
|
void setEmployeePFContribution(double);
|
||||||
void setEmployerPFContribution(double);
|
void setEmployerPFContribution(double);
|
||||||
|
virtual std::string serialize() const;
|
||||||
|
static std::shared_ptr<Payroll> deserialize(const std::string&);
|
||||||
|
static std::string getHeaders();
|
||||||
};
|
};
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
#include "Payslip.h"
|
#include "Payslip.h"
|
||||||
|
|
||||||
int Payslip::m_pid = 0;
|
int Payslip::m_uid = 0;
|
||||||
|
|
||||||
const std::string& Payslip::getPayslipId() const
|
const std::string& Payslip::getPayslipId() const
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,12 +4,12 @@
|
|||||||
class Payslip
|
class Payslip
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
static int m_pid;
|
static int m_uid;
|
||||||
std::string m_id;
|
std::string m_id;
|
||||||
double m_salary;
|
double m_salary;
|
||||||
public:
|
public:
|
||||||
Payslip() : m_id("PS" + std::to_string(++m_pid)), m_salary(0.0) {}
|
Payslip() : m_id("PS" + std::to_string(++m_uid)), m_salary(0.0) {}
|
||||||
Payslip(const double salary) : m_id("PS" + std::to_string(++m_pid)), m_salary(salary) {}
|
Payslip(const double salary) : m_id("PS" + std::to_string(++m_uid)), m_salary(salary) {}
|
||||||
const std::string& getPayslipId() const;
|
const std::string& getPayslipId() const;
|
||||||
double getSalary() const;
|
double getSalary() const;
|
||||||
void setPayslipId(const std::string& id);
|
void setPayslipId(const std::string& id);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#include "Room.h"
|
#include "Room.h"
|
||||||
|
|
||||||
int Room::m_rid = 0;
|
int Room::m_uid = 0;
|
||||||
|
|
||||||
const std::string& Room::getRoomId() const
|
const std::string& Room::getRoomId() const
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -8,13 +8,13 @@ using bookingMap = std::map<std::string, std::shared_ptr<Booking>>;
|
|||||||
class Room
|
class Room
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
static int m_rid;
|
static int m_uid;
|
||||||
std::string m_id;
|
std::string m_id;
|
||||||
std::string m_name;
|
std::string m_name;
|
||||||
bookingMap m_bookings;
|
bookingMap m_bookings;
|
||||||
public:
|
public:
|
||||||
Room() : m_id("RM" + std::to_string(++m_rid)), m_name("") {}
|
Room() : m_id("RM" + std::to_string(++m_uid)), m_name("") {}
|
||||||
Room(const std::string& name) : m_id("RM" + std::to_string(++m_rid)), m_name(name) {}
|
Room(const std::string& name) : m_id("RM" + std::to_string(++m_uid)), m_name(name) {}
|
||||||
const std::string& getRoomId() const;
|
const std::string& getRoomId() const;
|
||||||
const std::string& getRoomName() const;
|
const std::string& getRoomName() const;
|
||||||
const bookingMap& getBookings() const;
|
const bookingMap& getBookings() const;
|
||||||
|
|||||||
@@ -10,7 +10,25 @@ public:
|
|||||||
const std::string& phone,
|
const std::string& phone,
|
||||||
const std::string& email,
|
const std::string& email,
|
||||||
std::shared_ptr<Payroll> payroll
|
std::shared_ptr<Payroll> payroll
|
||||||
) :Employee(name, phone, email, Enums::EmployeeType::TAG, payroll) {};
|
) :Employee(name, phone, email, Enums::EmployeeType::TALENT_ACQUISITION, payroll) {};
|
||||||
|
TalentExecutive(const std::string& id,
|
||||||
|
const std::string& name,
|
||||||
|
const std::string& phone,
|
||||||
|
const std::string& password,
|
||||||
|
const std::string& email,
|
||||||
|
const std::string& teamId,
|
||||||
|
Enums::TeamStatus teamStatus,
|
||||||
|
Enums::AccountStatus accountStatus)
|
||||||
|
: Employee(id,
|
||||||
|
name,
|
||||||
|
phone,
|
||||||
|
password,
|
||||||
|
email,
|
||||||
|
teamId,
|
||||||
|
teamStatus,
|
||||||
|
Enums::EmployeeType::TALENT_ACQUISITION,
|
||||||
|
accountStatus) {
|
||||||
|
}
|
||||||
~TalentExecutive() = default;
|
~TalentExecutive() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#include "Team.h"
|
#include "Team.h"
|
||||||
|
|
||||||
int Team::m_tmid = 0;
|
int Team::m_uid = 0;
|
||||||
|
|
||||||
const std::string& Team::getTeamId() const
|
const std::string& Team::getTeamId() const
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -8,19 +8,19 @@ using employeeMap = std::map<std::string, std::shared_ptr<Employee>>;
|
|||||||
class Team
|
class Team
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
static int m_tmid;
|
static int m_uid;
|
||||||
std::string m_id;
|
std::string m_id;
|
||||||
std::string m_name;
|
std::string m_name;
|
||||||
std::shared_ptr<Employee> m_lead;
|
std::shared_ptr<Employee> m_lead;
|
||||||
employeeMap m_employees;
|
employeeMap m_employees;
|
||||||
int m_maximumNumberOfEmployees;
|
int m_maximumNumberOfEmployees;
|
||||||
public:
|
public:
|
||||||
Team() : m_id("TM" + std::to_string(++m_tmid)), m_name(""), m_lead(nullptr), m_maximumNumberOfEmployees(0) {}
|
Team() : m_id("TM" + std::to_string(++m_uid)), m_name(""), m_lead(nullptr), m_maximumNumberOfEmployees(0) {}
|
||||||
Team(
|
Team(
|
||||||
const std::string& name,
|
const std::string& name,
|
||||||
std::shared_ptr<Employee> lead,
|
std::shared_ptr<Employee> lead,
|
||||||
int maximumNumberOfEmployees)
|
int maximumNumberOfEmployees)
|
||||||
: m_id("TM" + std::to_string(++m_tmid)), m_name(name), m_lead(lead), m_maximumNumberOfEmployees(maximumNumberOfEmployees) {
|
: m_id("TM" + std::to_string(++m_uid)), m_name(name), m_lead(lead), m_maximumNumberOfEmployees(maximumNumberOfEmployees) {
|
||||||
}
|
}
|
||||||
const std::string& getTeamId() const;
|
const std::string& getTeamId() const;
|
||||||
const std::string& getTeamName() const;
|
const std::string& getTeamName() const;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#include "Ticket.h"
|
#include "Ticket.h"
|
||||||
|
|
||||||
int Ticket::m_tid = 0;
|
int Ticket::m_uid = 0;
|
||||||
|
|
||||||
const std::string& Ticket::getTicketId() const
|
const std::string& Ticket::getTicketId() const
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -5,20 +5,20 @@
|
|||||||
class Ticket
|
class Ticket
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
static int m_tid;
|
static int m_uid;
|
||||||
std::string m_id;
|
std::string m_id;
|
||||||
Enums::TicketType m_type;
|
Enums::TicketType m_type;
|
||||||
std::string m_description;
|
std::string m_description;
|
||||||
Enums::TicketStatus m_status;
|
Enums::TicketStatus m_status;
|
||||||
std::string m_employeeId;
|
std::string m_employeeId;
|
||||||
public:
|
public:
|
||||||
Ticket() : m_id("TKT" + std::to_string(++m_tid)), m_type(Enums::TicketType::UNKNOWN), m_description(""), m_status(Enums::TicketStatus::OPEN), m_employeeId("") {}
|
Ticket() : m_id("TKT" + std::to_string(++m_uid)), m_type(Enums::TicketType::UNKNOWN), m_description(""), m_status(Enums::TicketStatus::OPEN), m_employeeId("") {}
|
||||||
Ticket(
|
Ticket(
|
||||||
Enums::TicketType type,
|
Enums::TicketType type,
|
||||||
const std::string& description,
|
const std::string& description,
|
||||||
const std::string& employeeId,
|
const std::string& employeeId,
|
||||||
Enums::TicketStatus status)
|
Enums::TicketStatus status)
|
||||||
: m_id("TKT" + std::to_string(++m_tid)), m_type(type), m_description(description), m_status(status), m_employeeId(employeeId) {}
|
: m_id("TKT" + std::to_string(++m_uid)), m_type(type), m_description(description), m_status(status), m_employeeId(employeeId) {}
|
||||||
const std::string& getTicketId() const;
|
const std::string& getTicketId() const;
|
||||||
Enums::TicketType getTicketType() const;
|
Enums::TicketType getTicketType() const;
|
||||||
const std::string& getDescription() const;
|
const std::string& getDescription() const;
|
||||||
|
|||||||
@@ -9,31 +9,32 @@ namespace Config
|
|||||||
|
|
||||||
namespace Payroll
|
namespace Payroll
|
||||||
{
|
{
|
||||||
constexpr double SENIOR_BASIC_SALARY = 0.0;
|
constexpr double SENIOR_BASIC_SALARY = 80000.0;
|
||||||
constexpr double SENIOR_HOUSE_RENT_ALLOWANCE = 0.0;
|
constexpr double SENIOR_HOUSE_RENT_ALLOWANCE = 32000.0;
|
||||||
constexpr double SENIOR_FOOD_ALLOWANCE = 0.0;
|
constexpr double SENIOR_FOOD_ALLOWANCE = 3000.0;
|
||||||
constexpr double SENIOR_EMPLOYEE_PF_CONTRIBUTION = 0.0;
|
constexpr double SENIOR_EMPLOYEE_PF_CONTRIBUTION = 9600.0;
|
||||||
constexpr double SENIOR_EMPLOYER_PF_CONTRIBUTION = 0.0;
|
constexpr double SENIOR_EMPLOYER_PF_CONTRIBUTION = 9600.0;
|
||||||
constexpr double JUNIOR_BASIC_SALARY = 0.0;
|
constexpr double JUNIOR_BASIC_SALARY = 25000.0;
|
||||||
constexpr double JUNIOR_HOUSE_RENT_ALLOWANCE = 0.0;
|
constexpr double JUNIOR_HOUSE_RENT_ALLOWANCE = 10000.0;
|
||||||
constexpr double JUNIOR_FOOD_ALLOWANCE = 0.0;
|
constexpr double JUNIOR_FOOD_ALLOWANCE = 1500.0;
|
||||||
constexpr double JUNIOR_EMPLOYEE_PF_CONTRIBUTION = 0.0;
|
constexpr double JUNIOR_EMPLOYEE_PF_CONTRIBUTION = 3000.0;
|
||||||
constexpr double JUNIOR_EMPLOYER_PF_CONTRIBUTION = 0.0;
|
constexpr double JUNIOR_EMPLOYER_PF_CONTRIBUTION = 3000.0;
|
||||||
constexpr double HR_MANAGER_BASIC_SALARY = 0.0;
|
constexpr double HR_MANAGER_BASIC_SALARY = 60000.0;
|
||||||
constexpr double HR_MANAGER_HOUSE_RENT_ALLOWANCE = 0.0;
|
constexpr double HR_MANAGER_HOUSE_RENT_ALLOWANCE = 24000.0;
|
||||||
constexpr double HR_MANAGER_FOOD_ALLOWANCE = 0.0;
|
constexpr double HR_MANAGER_FOOD_ALLOWANCE = 2500.0;
|
||||||
constexpr double HR_MANAGER_EMPLOYEE_PF_CONTRIBUTION = 0.0;
|
constexpr double HR_MANAGER_EMPLOYEE_PF_CONTRIBUTION = 7200.0;
|
||||||
constexpr double HR_MANAGER_EMPLOYER_PF_CONTRIBUTION = 0.0;
|
constexpr double HR_MANAGER_EMPLOYER_PF_CONTRIBUTION = 7200.0;
|
||||||
constexpr double EXECUTIVE_BASIC_SALARY = 0.0;
|
constexpr double EXECUTIVE_BASIC_SALARY = 45000.0;
|
||||||
constexpr double EXECUTIVE_HOUSE_RENT_ALLOWANCE = 0.0;
|
constexpr double EXECUTIVE_HOUSE_RENT_ALLOWANCE = 18000.0;
|
||||||
constexpr double EXECUTIVE_FOOD_ALLOWANCE = 0.0;
|
constexpr double EXECUTIVE_FOOD_ALLOWANCE = 2000.0;
|
||||||
constexpr double EXECUTIVE_EMPLOYEE_PF_CONTRIBUTION = 0.0;
|
constexpr double EXECUTIVE_EMPLOYEE_PF_CONTRIBUTION = 5400.0;
|
||||||
constexpr double EXECUTIVE_EMPLOYER_PF_CONTRIBUTION = 0.0;
|
constexpr double EXECUTIVE_EMPLOYER_PF_CONTRIBUTION = 5400.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace File
|
namespace File
|
||||||
{
|
{
|
||||||
constexpr const char* EMPLOYEES_FILE = "files/Employee.csv";
|
constexpr const char* EMPLOYEES_FILE = "files/Employee.csv";
|
||||||
constexpr const char* GENERAL_EMPLOYEES_FILE = "files/GeneralEmployee.csv";
|
constexpr const char* GENERAL_EMPLOYEES_FILE = "files/GeneralEmployee.csv";
|
||||||
|
constexpr const char* PAYROLL_FILE = "files/Payroll.csv";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ void EmployeeManagementService::createEmployee(Enums::EmployeeType employeeType,
|
|||||||
case Enums::EmployeeType::IT:
|
case Enums::EmployeeType::IT:
|
||||||
case Enums::EmployeeType::FINANCE:
|
case Enums::EmployeeType::FINANCE:
|
||||||
case Enums::EmployeeType::TEAM:
|
case Enums::EmployeeType::TEAM:
|
||||||
case Enums::EmployeeType::TAG:
|
case Enums::EmployeeType::TALENT_ACQUISITION:
|
||||||
util::enforceAuthorization(authenticatedEmployeeType, Enums::EmployeeType::ADMIN, Enums::EmployeeType::HR);
|
util::enforceAuthorization(authenticatedEmployeeType, Enums::EmployeeType::ADMIN, Enums::EmployeeType::HR);
|
||||||
payroll = Factory::getObject<Payroll>(Config::Payroll::EXECUTIVE_BASIC_SALARY,
|
payroll = Factory::getObject<Payroll>(Config::Payroll::EXECUTIVE_BASIC_SALARY,
|
||||||
Config::Payroll::EXECUTIVE_HOUSE_RENT_ALLOWANCE,
|
Config::Payroll::EXECUTIVE_HOUSE_RENT_ALLOWANCE,
|
||||||
@@ -77,7 +77,7 @@ void EmployeeManagementService::createEmployee(Enums::EmployeeType employeeType,
|
|||||||
case Enums::EmployeeType::TEAM:
|
case Enums::EmployeeType::TEAM:
|
||||||
employee = Factory::getObject<TeamExecutive>(name, phone, email, payroll);
|
employee = Factory::getObject<TeamExecutive>(name, phone, email, payroll);
|
||||||
break;
|
break;
|
||||||
case Enums::EmployeeType::TAG:
|
case Enums::EmployeeType::TALENT_ACQUISITION:
|
||||||
employee = Factory::getObject <TalentExecutive> (name, phone, email, payroll);
|
employee = Factory::getObject <TalentExecutive> (name, phone, email, payroll);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -108,6 +108,8 @@ void EmployeeManagementService::createEmployee(Enums::EmployeeType employeeType,
|
|||||||
default:
|
default:
|
||||||
throw std::runtime_error("Invalid Employee Type");
|
throw std::runtime_error("Invalid Employee Type");
|
||||||
}
|
}
|
||||||
|
payroll->setEmployeeId(employee->getId());
|
||||||
|
m_dataStore.getPayrolls().emplace(std::make_pair(payroll->getId(), payroll));
|
||||||
m_dataStore.getEmployees().emplace(std::make_pair(employee->getId(), employee));
|
m_dataStore.getEmployees().emplace(std::make_pair(employee->getId(), employee));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
|
#include <stdexcept>
|
||||||
#include "PayslipManagementService.h"
|
#include "PayslipManagementService.h"
|
||||||
|
#include "ApplicationConfig.h"
|
||||||
#include "AuthorizationHelper.h"
|
#include "AuthorizationHelper.h"
|
||||||
#include "Enums.h"
|
#include "Enums.h"
|
||||||
|
#include "FileManager.h"
|
||||||
|
|
||||||
void PayslipManagementService::updateSalary(const std::string& employeeId, double basicSalary, double houseRentAllowance, double foodAllowance, double employeePFContribution, double employerPFContribution)
|
void PayslipManagementService::updateSalary(const std::string& employeeId, double basicSalary, double houseRentAllowance, double foodAllowance, double employeePFContribution, double employerPFContribution)
|
||||||
{
|
{
|
||||||
@@ -19,3 +22,28 @@ void PayslipManagementService::updateSalary(const std::string& employeeId, doubl
|
|||||||
throw std::runtime_error("Employee not found, unable to update the salary");
|
throw std::runtime_error("Employee not found, unable to update the salary");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PayslipManagementService::loadPayrolls()
|
||||||
|
{
|
||||||
|
FileManager<Payroll> payrollFileManager(Config::File::PAYROLL_FILE);
|
||||||
|
auto& payrolls = m_dataStore.getPayrolls();
|
||||||
|
auto& employees = m_dataStore.getEmployees();
|
||||||
|
auto payrollObjects = payrollFileManager.load();
|
||||||
|
for (const auto& payrollPair : payrollObjects)
|
||||||
|
{
|
||||||
|
auto employeeIterator = employees.find(payrollPair.second->getEmployeeId());
|
||||||
|
if (employeeIterator == employees.end())
|
||||||
|
{
|
||||||
|
throw std::runtime_error("Payroll Object not associated with an existing employee");
|
||||||
|
}
|
||||||
|
employeeIterator->second->setEmployeePayroll(payrollPair.second);
|
||||||
|
}
|
||||||
|
payrolls.insert(payrollObjects.begin(), payrollObjects.end());
|
||||||
|
}
|
||||||
|
|
||||||
|
void PayslipManagementService::savePayrolls()
|
||||||
|
{
|
||||||
|
FileManager<Payroll> payrollFileManager(Config::File::PAYROLL_FILE);
|
||||||
|
auto& payrolls = m_dataStore.getPayrolls();
|
||||||
|
payrollFileManager.save(payrolls);
|
||||||
|
}
|
||||||
@@ -10,4 +10,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);
|
||||||
|
void loadPayrolls();
|
||||||
|
void savePayrolls();
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ namespace Enums {
|
|||||||
GENERAL,
|
GENERAL,
|
||||||
IT,
|
IT,
|
||||||
FINANCE,
|
FINANCE,
|
||||||
TAG,
|
TALENT_ACQUISITION,
|
||||||
HR,
|
HR,
|
||||||
TEAM,
|
TEAM,
|
||||||
ADMIN,
|
ADMIN,
|
||||||
@@ -114,8 +114,8 @@ namespace Enums {
|
|||||||
return "IT";
|
return "IT";
|
||||||
case EmployeeType::FINANCE:
|
case EmployeeType::FINANCE:
|
||||||
return "FINANCE";
|
return "FINANCE";
|
||||||
case EmployeeType::TAG:
|
case EmployeeType::TALENT_ACQUISITION:
|
||||||
return "TAG";
|
return "TALENT_ACQUISITION";
|
||||||
case EmployeeType::HR:
|
case EmployeeType::HR:
|
||||||
return "HR";
|
return "HR";
|
||||||
case EmployeeType::TEAM:
|
case EmployeeType::TEAM:
|
||||||
@@ -176,8 +176,8 @@ namespace Enums {
|
|||||||
return EmployeeType::IT;
|
return EmployeeType::IT;
|
||||||
if (input == "FINANCE")
|
if (input == "FINANCE")
|
||||||
return EmployeeType::FINANCE;
|
return EmployeeType::FINANCE;
|
||||||
if (input == "TAG")
|
if (input == "TALENT_ACQUISITION")
|
||||||
return EmployeeType::TAG;
|
return EmployeeType::TALENT_ACQUISITION;
|
||||||
if (input == "HR")
|
if (input == "HR")
|
||||||
return EmployeeType::HR;
|
return EmployeeType::HR;
|
||||||
if (input == "TEAM")
|
if (input == "TEAM")
|
||||||
|
|||||||
@@ -11,14 +11,14 @@ static Enums::EmployeeType getEmployeeType(Enums::EmployeeType employeeType)
|
|||||||
Enums::EmployeeType::IT,
|
Enums::EmployeeType::IT,
|
||||||
Enums::EmployeeType::TEAM,
|
Enums::EmployeeType::TEAM,
|
||||||
Enums::EmployeeType::FINANCE,
|
Enums::EmployeeType::FINANCE,
|
||||||
Enums::EmployeeType::TAG,
|
Enums::EmployeeType::TALENT_ACQUISITION,
|
||||||
Enums::EmployeeType::GENERAL
|
Enums::EmployeeType::GENERAL
|
||||||
}},
|
}},
|
||||||
{ Enums::EmployeeType::HR, {
|
{ Enums::EmployeeType::HR, {
|
||||||
Enums::EmployeeType::IT,
|
Enums::EmployeeType::IT,
|
||||||
Enums::EmployeeType::TEAM,
|
Enums::EmployeeType::TEAM,
|
||||||
Enums::EmployeeType::FINANCE,
|
Enums::EmployeeType::FINANCE,
|
||||||
Enums::EmployeeType::TAG,
|
Enums::EmployeeType::TALENT_ACQUISITION,
|
||||||
Enums::EmployeeType::GENERAL
|
Enums::EmployeeType::GENERAL
|
||||||
}}
|
}}
|
||||||
};
|
};
|
||||||
@@ -27,7 +27,7 @@ static Enums::EmployeeType getEmployeeType(Enums::EmployeeType employeeType)
|
|||||||
{ Enums::EmployeeType::IT, "IT Executive" },
|
{ Enums::EmployeeType::IT, "IT Executive" },
|
||||||
{ Enums::EmployeeType::TEAM, "Team Executive" },
|
{ Enums::EmployeeType::TEAM, "Team Executive" },
|
||||||
{ Enums::EmployeeType::FINANCE, "Finance Executive" },
|
{ Enums::EmployeeType::FINANCE, "Finance Executive" },
|
||||||
{ Enums::EmployeeType::TAG, "Talent Executive" },
|
{ Enums::EmployeeType::TALENT_ACQUISITION, "Talent Executive" },
|
||||||
{ Enums::EmployeeType::GENERAL, "General Employee" }
|
{ Enums::EmployeeType::GENERAL, "General Employee" }
|
||||||
};
|
};
|
||||||
auto it = employeeTypeOptions.find(employeeType);
|
auto it = employeeTypeOptions.find(employeeType);
|
||||||
|
|||||||
@@ -151,7 +151,7 @@ void UserInterface::login()
|
|||||||
menu.run();
|
menu.run();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case Enums::EmployeeType::TAG:
|
case Enums::EmployeeType::TALENT_ACQUISITION:
|
||||||
{
|
{
|
||||||
TalentExecutiveMenu menu;
|
TalentExecutiveMenu menu;
|
||||||
menu.run();
|
menu.run();
|
||||||
|
|||||||
Reference in New Issue
Block a user