Set up employee management codebase
<SRS>SRS02 : Employee Management </SRS> <Changes> - Renamed EmployeeManagememtService to EmployeeManagementService - Added basic employee management service structure - Connected employee management into controller and datastore - Updated project config files - Added auto ID generation across models - Added payroll-related config constants </Changes> <Review> Smitha Mohan </Review>
This commit is contained in:
@@ -150,7 +150,7 @@
|
||||
<ClCompile Include="services\AttendanceManagementService.cpp" />
|
||||
<ClCompile Include="services\AuthenticationManagementService.cpp" />
|
||||
<ClCompile Include="services\BookingManagementService.cpp" />
|
||||
<ClCompile Include="services\EmployeeManagememtService.cpp" />
|
||||
<ClCompile Include="services\EmployeeManagementService.cpp" />
|
||||
<ClCompile Include="services\LeaveManagementService.cpp" />
|
||||
<ClCompile Include="services\LogService.cpp" />
|
||||
<ClCompile Include="services\NotificationManagementService.cpp" />
|
||||
@@ -204,7 +204,7 @@
|
||||
<ClInclude Include="services\AttendanceManagementService.h" />
|
||||
<ClInclude Include="services\AuthenticationManagementService.h" />
|
||||
<ClInclude Include="services\BookingManagementService.h" />
|
||||
<ClInclude Include="services\EmployeeManagememtService.h" />
|
||||
<ClInclude Include="services\EmployeeManagementService.h" />
|
||||
<ClInclude Include="services\LeaveManagementService.h" />
|
||||
<ClInclude Include="services\LogService.h" />
|
||||
<ClInclude Include="services\NotificationManagementService.h" />
|
||||
|
||||
@@ -39,9 +39,6 @@
|
||||
<ClCompile Include="services\AuthenticationManagementService.cpp">
|
||||
<Filter>Services</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="services\EmployeeManagememtService.cpp">
|
||||
<Filter>Services</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="services\AttendanceManagementService.cpp">
|
||||
<Filter>Services</Filter>
|
||||
</ClCompile>
|
||||
@@ -192,14 +189,14 @@
|
||||
<ClCompile Include="services\ApplicationConfig.cpp">
|
||||
<Filter>Services</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="services\EmployeeManagementService.cpp">
|
||||
<Filter>Services</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="services\AuthenticationManagementService.h">
|
||||
<Filter>Services</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="services\EmployeeManagememtService.h">
|
||||
<Filter>Services</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="services\TicketManagementService.h">
|
||||
<Filter>Services</Filter>
|
||||
</ClInclude>
|
||||
@@ -338,6 +335,9 @@
|
||||
<ClInclude Include="services\ApplicationConfig.h">
|
||||
<Filter>Services</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="services\EmployeeManagementService.h">
|
||||
<Filter>Services</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="models\Employee.h">
|
||||
|
||||
@@ -15,3 +15,22 @@ void ZenvyController::changePassword(const std::string& password)
|
||||
{
|
||||
m_authenticationManagementService->changePassword(password);
|
||||
}
|
||||
|
||||
//Employee Management
|
||||
void ZenvyController::createEmployee(Enums::EmployeeType employeeType, const std::string& email, const std::string& password, const std::string& name, const std::string& phone)
|
||||
{
|
||||
m_employeeManagementService->createEmployee(employeeType, email, password, name, phone);
|
||||
}
|
||||
|
||||
bool ZenvyController::deactivateEmployee(const std::string& id)
|
||||
{
|
||||
return m_employeeManagementService->deactivateEmployee(id);
|
||||
}
|
||||
|
||||
Employees EmployeeManagementService::getEmployees()
|
||||
{
|
||||
}
|
||||
|
||||
std::shared_ptr<const Employee> EmployeeManagementService::getEmployee(const std::string& id)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "AuthenticationManagementService.h"
|
||||
#include "AttendanceManagementService.h"
|
||||
#include "BookingManagementService.h"
|
||||
#include "EmployeeManagememtService.h"
|
||||
#include "EmployeeManagementService.h"
|
||||
#include "LeaveManagementService.h"
|
||||
#include "NotificationManagementService.h"
|
||||
#include "PayslipManagementService.h"
|
||||
@@ -19,7 +19,7 @@ private:
|
||||
std::shared_ptr<AuthenticationManagementService> m_authenticationManagementService;
|
||||
std::shared_ptr<AttendanceManagementService> m_attendanceManagementService;
|
||||
std::shared_ptr<BookingManagementService> m_bookingManagementService;
|
||||
std::shared_ptr<EmployeeManagememtService> m_employeeManagememtService;
|
||||
std::shared_ptr<EmployeeManagementService> m_employeeManagementService;
|
||||
std::shared_ptr<LeaveManagementService> m_leaveManagementService;
|
||||
std::shared_ptr<NotificationManagementService> m_notificationManagementService;
|
||||
std::shared_ptr<PayslipManagementService> m_payslipManagementService;
|
||||
@@ -31,7 +31,7 @@ public:
|
||||
m_authenticationManagementService(std::make_shared<AuthenticationManagementService>()),
|
||||
m_attendanceManagementService(std::make_shared<AttendanceManagementService>()),
|
||||
m_bookingManagementService(std::make_shared<BookingManagementService>()),
|
||||
m_employeeManagememtService(std::make_shared<EmployeeManagememtService>()),
|
||||
m_employeeManagementService(std::make_shared<EmployeeManagementService>()),
|
||||
m_leaveManagementService(std::make_shared<LeaveManagementService>()),
|
||||
m_notificationManagementService(std::make_shared<NotificationManagementService>()),
|
||||
m_payslipManagementService(std::make_shared<PayslipManagementService>()),
|
||||
@@ -43,4 +43,10 @@ public:
|
||||
AuthenticationDTO login(const std::string& email, const std::string& password);
|
||||
void logout();
|
||||
void changePassword(const std::string&);
|
||||
|
||||
//Employee Management
|
||||
void createEmployee(Enums::EmployeeType, const std::string&, const std::string&, const std::string&, const std::string&);
|
||||
bool deactivateEmployee(const std::string&);
|
||||
Employees getEmployees();
|
||||
std::shared_ptr<const Employee> getEmployee(const std::string&);
|
||||
};
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "DataStore.h"
|
||||
#include "EmployeeManagementService.h"
|
||||
|
||||
DataStore& DataStore::getInstance()
|
||||
{
|
||||
|
||||
@@ -3,4 +3,15 @@
|
||||
|
||||
class Admin : public Employee
|
||||
{
|
||||
Admin() = default;
|
||||
Admin(
|
||||
const std::string& password,
|
||||
const std::string& name,
|
||||
const std::string& phone,
|
||||
const std::string& email,
|
||||
const std::string& teamId,
|
||||
std::shared_ptr<Payroll> payroll
|
||||
) :Employee(password, name, phone, email, teamId, Enums::EmployeeType::GENERAL, payroll) {
|
||||
};
|
||||
~Admin() = default;
|
||||
};
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#include "Announcement.h"
|
||||
|
||||
int Announcement::m_anid = 0;
|
||||
|
||||
const std::string& Announcement::getAnnouncementId() const
|
||||
{
|
||||
return m_id;
|
||||
|
||||
@@ -5,14 +5,14 @@
|
||||
class Announcement
|
||||
{
|
||||
private:
|
||||
static int m_anid;
|
||||
std::string m_id;
|
||||
util::Timestamp m_timestamp;
|
||||
std::string m_message;
|
||||
public:
|
||||
Announcement() : m_id(""), m_timestamp(), m_message("") {}
|
||||
Announcement(const std::string& id,
|
||||
const std::string& message)
|
||||
: m_id(id), m_message(message) {}
|
||||
Announcement() : m_id("AN" + std::to_string(++m_anid)), m_timestamp(), m_message("") {}
|
||||
Announcement(const std::string& message)
|
||||
: m_id("AN" + std::to_string(++m_anid)), m_message(message) {}
|
||||
const std::string& getAnnouncementId() const;
|
||||
const util::Timestamp& getAnnouncementTimestamp() const;
|
||||
const std::string& getAnnouncementMessage() const;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#include "Attendance.h"
|
||||
|
||||
int Attendance::m_aid = 0;
|
||||
|
||||
const std::string& Attendance::getAttendanceId() const
|
||||
{
|
||||
return m_id;
|
||||
|
||||
@@ -5,15 +5,15 @@
|
||||
class Attendance
|
||||
{
|
||||
private:
|
||||
static int m_aid;
|
||||
std::string m_id;
|
||||
util::Timestamp m_loginTime;
|
||||
util::Timestamp m_logoutTime;
|
||||
public:
|
||||
Attendance() : m_id(""), m_loginTime(), m_logoutTime() {}
|
||||
Attendance(const std::string& id,
|
||||
const util::Timestamp& loginTime,
|
||||
Attendance() : m_id("AD" + std::to_string(++m_aid)), m_loginTime(), m_logoutTime() {}
|
||||
Attendance(const util::Timestamp& loginTime,
|
||||
const util::Timestamp& logoutTime)
|
||||
: m_id(id), m_loginTime(loginTime), m_logoutTime(logoutTime) {}
|
||||
: m_id("AD" + std::to_string(++m_aid)), m_loginTime(loginTime), m_logoutTime(logoutTime) {}
|
||||
const std::string& getAttendanceId() const;
|
||||
const util::Timestamp& getLoginTime() const;
|
||||
const util::Timestamp& getLogoutTime() const;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#include "Booking.h"
|
||||
|
||||
int Booking::m_bid = 0;
|
||||
|
||||
const std::string& Booking::getBookingId() const
|
||||
{
|
||||
return m_id;
|
||||
|
||||
@@ -7,19 +7,19 @@
|
||||
class Booking
|
||||
{
|
||||
private:
|
||||
static int m_bid;
|
||||
std::string m_id;
|
||||
util::Timestamp m_startTime;
|
||||
util::Timestamp m_endTime;
|
||||
std::string m_employeeId;
|
||||
std::shared_ptr<Team> m_team;
|
||||
public:
|
||||
Booking() : m_id(""), m_startTime(), m_endTime(), m_employeeId(""), m_team(nullptr) {}
|
||||
Booking(const std::string& id,
|
||||
const util::Timestamp& startTime,
|
||||
Booking() : m_id("BK" + std::to_string(++m_bid)), m_startTime(), m_endTime(), m_employeeId(""), m_team(nullptr) {}
|
||||
Booking(const util::Timestamp& startTime,
|
||||
const util::Timestamp& endTime,
|
||||
const std::string& employeeId,
|
||||
std::shared_ptr<Team> team)
|
||||
: m_id(id), m_startTime(startTime), m_endTime(endTime), m_employeeId(employeeId), m_team(team) {}
|
||||
: m_id("BK" + std::to_string(++m_bid)), m_startTime(startTime), m_endTime(endTime), m_employeeId(employeeId), m_team(team) {}
|
||||
const std::string& getBookingId() const;
|
||||
const util::Timestamp& getStartTime() const;
|
||||
const util::Timestamp& getEndTime() const;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#include "Candidate.h"
|
||||
|
||||
int Candidate::m_cid = 0;
|
||||
|
||||
const std::string& Candidate::getCandidateId() const
|
||||
{
|
||||
return m_id;
|
||||
|
||||
@@ -5,19 +5,19 @@
|
||||
class Candidate
|
||||
{
|
||||
private:
|
||||
static int m_cid;
|
||||
std::string m_id;
|
||||
std::string m_name;
|
||||
long int m_phone;
|
||||
std::string m_qualification;
|
||||
Enums::CandidateStatus m_status;
|
||||
public:
|
||||
Candidate() : m_id(""), m_name(""), m_phone(0), m_qualification(""), m_status(Enums::CandidateStatus::PENDING) {}
|
||||
Candidate(const std::string& id,
|
||||
const std::string& name,
|
||||
Candidate() : m_id("CD" + std::to_string(++m_cid)), m_name(""), m_phone(0), m_qualification(""), m_status(Enums::CandidateStatus::PENDING) {}
|
||||
Candidate(const std::string& name,
|
||||
long int phone,
|
||||
const std::string& qualification,
|
||||
Enums::CandidateStatus status)
|
||||
: m_id(id), m_name(name), m_phone(phone), m_qualification(qualification), m_status(status) {}
|
||||
: m_id("CD" + std::to_string(++m_cid)), m_name(name), m_phone(phone), m_qualification(qualification), m_status(status) {}
|
||||
const std::string& getCandidateId() const;
|
||||
const std::string& getCandidateName() const;
|
||||
long int getCandidatePhone() const;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#include "Employee.h"
|
||||
|
||||
int Employee::m_uid = 0;
|
||||
|
||||
const std::string& Employee::getEmployeeId() const
|
||||
{
|
||||
return m_id;
|
||||
|
||||
@@ -14,6 +14,7 @@ using leaveMap = std::map<std::string, std::shared_ptr<Leave>>;
|
||||
class Employee
|
||||
{
|
||||
private:
|
||||
static int m_uid;
|
||||
std::string m_id;
|
||||
std::string m_password;
|
||||
std::string m_name;
|
||||
@@ -28,16 +29,15 @@ private:
|
||||
leaveMap m_leaves;
|
||||
Enums::EmployeeType m_employeeType;
|
||||
public:
|
||||
Employee() : m_id(""), m_password(""), m_name(""), m_phone(""), m_email(""), m_accountStatus(Enums::AccountStatus::ACTIVE), m_teamStatus(Enums::TeamStatus::NOT_IN_TEAM), m_teamId(""), m_employeeType(Enums::EmployeeType::GENERAL) {}
|
||||
Employee(const std::string& id,
|
||||
const std::string& password,
|
||||
Employee() : m_id("EMP" + std::to_string(++m_uid)), m_password(""), m_name(""), m_phone(""), m_email(""), m_accountStatus(Enums::AccountStatus::ACTIVE), m_teamStatus(Enums::TeamStatus::NOT_IN_TEAM), m_teamId(""), m_employeeType(Enums::EmployeeType::GENERAL) {}
|
||||
Employee(const std::string& password,
|
||||
const std::string& name,
|
||||
const std::string& phone,
|
||||
const std::string& email,
|
||||
const std::string& teamId,
|
||||
Enums::EmployeeType employeeType,
|
||||
std::shared_ptr<Payroll> payroll)
|
||||
: m_id(id), m_password(password), m_name(name), m_phone(phone), m_email(email), m_accountStatus(Enums::AccountStatus::ACTIVE), m_teamStatus(Enums::TeamStatus::NOT_IN_TEAM), m_teamId(teamId), m_employeeType(employeeType), m_payroll(payroll) { }
|
||||
: m_id("EMP" + std::to_string(++m_uid)), m_password(password), m_name(name), m_phone(phone), m_email(email), m_accountStatus(Enums::AccountStatus::ACTIVE), m_teamStatus(Enums::TeamStatus::NOT_IN_TEAM), m_teamId(teamId), m_employeeType(employeeType), m_payroll(payroll) { }
|
||||
const std::string& getEmployeeId() const;
|
||||
const std::string& getEmployeePassword() const;
|
||||
const std::string& getEmployeeName() const;
|
||||
|
||||
@@ -1,7 +1,19 @@
|
||||
#pragma once
|
||||
#include<string>
|
||||
#include "Employee.h"
|
||||
|
||||
class FinanceExecutive : public Employee
|
||||
{
|
||||
public:
|
||||
FinanceExecutive() = default;
|
||||
FinanceExecutive(
|
||||
const std::string& password,
|
||||
const std::string& name,
|
||||
const std::string& phone,
|
||||
const std::string& email,
|
||||
const std::string& teamId,
|
||||
std::shared_ptr<Payroll> payroll
|
||||
) :Employee(password, name, phone, email, teamId, Enums::EmployeeType::GENERAL, payroll) {};
|
||||
~FinanceExecutive() = default;
|
||||
};
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ public:
|
||||
const std::string& email,
|
||||
const std::string& teamId,
|
||||
std::shared_ptr<Payroll> payroll,
|
||||
Enums::EmployeeDesignation designation) : Employee(id, password, name, phone, email, teamId,Enums::EmployeeType::GENERAL, payroll), m_designation(designation) {}
|
||||
Enums::EmployeeDesignation designation) : Employee(password, name, phone, email, teamId,Enums::EmployeeType::GENERAL, payroll), m_designation(designation) {}
|
||||
Enums::EmployeeDesignation getDesignation() const;
|
||||
void setDesignation(Enums::EmployeeDesignation designation);
|
||||
~GeneralEmployee() = default;
|
||||
|
||||
@@ -3,5 +3,16 @@
|
||||
|
||||
class HRManager : public Employee
|
||||
{
|
||||
HRManager() = default;
|
||||
HRManager(
|
||||
const std::string& password,
|
||||
const std::string& name,
|
||||
const std::string& phone,
|
||||
const std::string& email,
|
||||
const std::string& teamId,
|
||||
std::shared_ptr<Payroll> payroll
|
||||
) :Employee(password, name, phone, email, teamId, Enums::EmployeeType::GENERAL, payroll) {
|
||||
};
|
||||
~HRManager() = default;
|
||||
};
|
||||
|
||||
|
||||
@@ -3,5 +3,16 @@
|
||||
|
||||
class ITExecutive : public Employee
|
||||
{
|
||||
ITExecutive() = default;
|
||||
ITExecutive(
|
||||
const std::string& password,
|
||||
const std::string& name,
|
||||
const std::string& phone,
|
||||
const std::string& email,
|
||||
const std::string& teamId,
|
||||
std::shared_ptr<Payroll> payroll
|
||||
) :Employee(password, name, phone, email, teamId, Enums::EmployeeType::GENERAL, payroll) {
|
||||
};
|
||||
~ITExecutive() = default;
|
||||
};
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#include "JobListing.h"
|
||||
|
||||
int JobListing::m_jid = 0;
|
||||
|
||||
const std::string& JobListing::getJobId() const
|
||||
{
|
||||
return m_id;
|
||||
|
||||
@@ -9,6 +9,7 @@ using candidateMap = std::map<std::string, std::shared_ptr<Candidate>>;
|
||||
class JobListing
|
||||
{
|
||||
private:
|
||||
static int m_jid;
|
||||
std::string m_id;
|
||||
std::string m_name;
|
||||
std::string m_description;
|
||||
@@ -16,14 +17,13 @@ private:
|
||||
int m_numberOfVacancies;
|
||||
candidateMap m_candidates;
|
||||
public:
|
||||
JobListing() : m_id(""), m_name(""), m_description(""), m_status(Enums::JobListingStatus::CLOSED), m_numberOfVacancies(0) {}
|
||||
JobListing(const std::string& id,
|
||||
const std::string& name,
|
||||
JobListing() : m_id("JL" + std::to_string(++m_jid)), m_name(""), m_description(""), m_status(Enums::JobListingStatus::CLOSED), m_numberOfVacancies(0) {}
|
||||
JobListing(const std::string& name,
|
||||
const std::string& description,
|
||||
Enums::JobListingStatus status,
|
||||
int numberOfVacancies,
|
||||
const candidateMap& candidates)
|
||||
: m_id(id), m_name(name), m_description(description), m_status(status), m_numberOfVacancies(numberOfVacancies), m_candidates(candidates) {}
|
||||
: m_id("JL" + std::to_string(++m_jid)), m_name(name), m_description(description), m_status(status), m_numberOfVacancies(numberOfVacancies), m_candidates(candidates) {}
|
||||
const std::string& getJobId() const;
|
||||
const std::string& getJobName() const;
|
||||
const std::string& getJobDescription() const;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#include "Leave.h"
|
||||
|
||||
int Leave::m_lid = 0;
|
||||
|
||||
const std::string& Leave::getLeaveId() const
|
||||
{
|
||||
return m_id;
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
class Leave
|
||||
{
|
||||
private:
|
||||
static int m_lid;
|
||||
std::string m_id;
|
||||
std::string m_employeeId;
|
||||
util::Timestamp m_timestamp;
|
||||
@@ -15,13 +16,12 @@ private:
|
||||
static int m_numberOfMedicalLeave;
|
||||
Enums::LeaveType m_leaveType;
|
||||
public:
|
||||
Leave() : m_id(""), m_employeeId(""), m_timestamp(), m_reason(""), m_leaveType(Enums::LeaveType::GENERAL) {}
|
||||
Leave(const std::string& id,
|
||||
const std::string& employeeId,
|
||||
Leave() : m_id("LV" + std::to_string(++m_lid)), m_employeeId(""), m_timestamp(), m_reason(""), m_leaveType(Enums::LeaveType::GENERAL) {}
|
||||
Leave(const std::string& employeeId,
|
||||
const util::Timestamp& timestamp,
|
||||
const std::string& reason,
|
||||
Enums::LeaveType leaveType)
|
||||
: m_id(id), m_employeeId(employeeId), m_timestamp(timestamp), m_reason(reason), m_leaveType(leaveType) {}
|
||||
: m_id("LV" + std::to_string(++m_lid)), m_employeeId(employeeId), m_timestamp(timestamp), m_reason(reason), m_leaveType(leaveType) {}
|
||||
const std::string& getLeaveId() const;
|
||||
const std::string& getEmployeeId() const;
|
||||
const util::Timestamp& getTimestamp() const;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#include "Notification.h"
|
||||
|
||||
int Notification::m_nid = 0;
|
||||
|
||||
const std::string& Notification::getNotificationId() const
|
||||
{
|
||||
return m_id;
|
||||
|
||||
@@ -6,18 +6,18 @@
|
||||
class Notification
|
||||
{
|
||||
private:
|
||||
static int m_nid;
|
||||
std::string m_id;
|
||||
std::string m_employeeId;
|
||||
std::string m_message;
|
||||
util::Timestamp m_timestamp;
|
||||
Enums::NotificationStatus m_notificationStatus;
|
||||
public:
|
||||
Notification() : m_id(""), m_employeeId(""), m_message(""), m_timestamp(), m_notificationStatus(Enums::NotificationStatus::UNREAD) {}
|
||||
Notification(const std::string& id,
|
||||
const std::string& employeeId,
|
||||
Notification() : m_id("NF" + std::to_string(++m_nid)), m_employeeId(""), m_message(""), m_timestamp(), m_notificationStatus(Enums::NotificationStatus::UNREAD) {}
|
||||
Notification(const std::string& employeeId,
|
||||
const std::string& message,
|
||||
Enums::NotificationStatus notificationStatus)
|
||||
: m_id(id), m_employeeId(employeeId), m_message(message), m_notificationStatus(notificationStatus) {}
|
||||
: m_id("NF" + std::to_string(++m_nid)), m_employeeId(employeeId), m_message(message), m_notificationStatus(notificationStatus) {}
|
||||
const std::string& getNotificationId() const;
|
||||
const std::string& getEmployeeId() const;
|
||||
const std::string& getNotificationMessage() const;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#include "Payroll.h"
|
||||
|
||||
int Payroll::m_prid = 0;
|
||||
|
||||
const std::string& Payroll::getPayrollId() const
|
||||
{
|
||||
return m_id;
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
class Payroll
|
||||
{
|
||||
private:
|
||||
static int m_prid;
|
||||
std::string m_id;
|
||||
double m_basicSalary;
|
||||
double m_houseRentAllowance;
|
||||
@@ -11,14 +12,13 @@ private:
|
||||
double m_employeePFContribution;
|
||||
double m_employerPFContribution;
|
||||
public:
|
||||
Payroll() : m_id(""), m_basicSalary(0.0), m_houseRentAllowance(0.0), m_foodAllowance(0.0), m_employeePFContribution(0.0), m_employerPFContribution(0.0) {}
|
||||
Payroll(const std::string& id,
|
||||
double basicSalary,
|
||||
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(double basicSalary,
|
||||
double houseRentAllowance,
|
||||
double foodAllowance,
|
||||
double employeePFContribution,
|
||||
double employerPFContribution)
|
||||
: m_id(id), m_basicSalary(basicSalary), m_houseRentAllowance(houseRentAllowance), m_foodAllowance(foodAllowance), m_employeePFContribution(employeePFContribution), m_employerPFContribution(employerPFContribution) {}
|
||||
: m_id("PR" + std::to_string(++m_prid)), m_basicSalary(basicSalary), m_houseRentAllowance(houseRentAllowance), m_foodAllowance(foodAllowance), m_employeePFContribution(employeePFContribution), m_employerPFContribution(employerPFContribution) {}
|
||||
const std::string& getPayrollId() const;
|
||||
double getBasicSalary() const;
|
||||
double getHouseRentAllowance() const;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#include "Payslip.h"
|
||||
|
||||
int Payslip::m_pid = 0;
|
||||
|
||||
const std::string& Payslip::getPayslipId() const
|
||||
{
|
||||
return m_id;
|
||||
|
||||
@@ -4,11 +4,12 @@
|
||||
class Payslip
|
||||
{
|
||||
private:
|
||||
static int m_pid;
|
||||
std::string m_id;
|
||||
double m_salary;
|
||||
public:
|
||||
Payslip() : m_id(""), m_salary(0.0) {}
|
||||
Payslip(const std::string& id, double salary) : m_id(id), m_salary(salary) {}
|
||||
Payslip() : m_id("PS" + std::to_string(++m_pid)), m_salary(0.0) {}
|
||||
Payslip(const double salary) : m_id("PS" + std::to_string(++m_pid)), m_salary(salary) {}
|
||||
const std::string& getPayslipId() const;
|
||||
double getSalary() const;
|
||||
void setPayslipId(const std::string& id);
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#include "Room.h"
|
||||
|
||||
int Room::m_rid = 0;
|
||||
|
||||
const std::string& Room::getRoomId() const
|
||||
{
|
||||
return m_id;
|
||||
|
||||
@@ -8,12 +8,13 @@ using bookingMap = std::map<std::string, std::shared_ptr<Booking>>;
|
||||
class Room
|
||||
{
|
||||
private:
|
||||
static int m_rid;
|
||||
std::string m_id;
|
||||
std::string m_name;
|
||||
bookingMap m_bookings;
|
||||
public:
|
||||
Room() : m_id(""), m_name("") {}
|
||||
Room(const std::string& id, const std::string& name) : m_id(id), m_name(name) {}
|
||||
Room() : m_id("RM" + std::to_string(++m_rid)), m_name("") {}
|
||||
Room(const std::string& name) : m_id("RM" + std::to_string(++m_rid)), m_name(name) {}
|
||||
const std::string& getRoomId() const;
|
||||
const std::string& getRoomName() const;
|
||||
const bookingMap& getBookings() const;
|
||||
|
||||
@@ -3,5 +3,16 @@
|
||||
|
||||
class TalentExecutive : public Employee
|
||||
{
|
||||
TalentExecutive() = default;
|
||||
TalentExecutive(
|
||||
const std::string& password,
|
||||
const std::string& name,
|
||||
const std::string& phone,
|
||||
const std::string& email,
|
||||
const std::string& teamId,
|
||||
std::shared_ptr<Payroll> payroll
|
||||
) :Employee(password, name, phone, email, teamId, Enums::EmployeeType::GENERAL, payroll) {
|
||||
};
|
||||
~TalentExecutive() = default;
|
||||
};
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#include "Team.h"
|
||||
|
||||
int Team::m_tmid = 0;
|
||||
|
||||
const std::string& Team::getTeamId() const
|
||||
{
|
||||
return m_id;
|
||||
|
||||
@@ -8,18 +8,19 @@ using employeeMap = std::map<std::string, std::shared_ptr<Employee>>;
|
||||
class Team
|
||||
{
|
||||
private:
|
||||
static int m_tmid;
|
||||
std::string m_id;
|
||||
std::string m_name;
|
||||
std::shared_ptr<Employee> m_lead;
|
||||
employeeMap m_employees;
|
||||
int m_maximumNumberOfEmployees;
|
||||
public:
|
||||
Team() : m_id(""), m_name(""), m_lead(nullptr), m_maximumNumberOfEmployees(0) {}
|
||||
Team(const std::string& id,
|
||||
Team() : m_id("TM" + std::to_string(++m_tmid)), m_name(""), m_lead(nullptr), m_maximumNumberOfEmployees(0) {}
|
||||
Team(
|
||||
const std::string& name,
|
||||
std::shared_ptr<Employee> lead,
|
||||
int maximumNumberOfEmployees)
|
||||
: m_id(id), m_name(name), m_lead(lead), m_maximumNumberOfEmployees(maximumNumberOfEmployees) {
|
||||
: m_id("TM" + std::to_string(++m_tmid)), m_name(name), m_lead(lead), m_maximumNumberOfEmployees(maximumNumberOfEmployees) {
|
||||
}
|
||||
const std::string& getTeamId() const;
|
||||
const std::string& getTeamName() const;
|
||||
|
||||
@@ -3,5 +3,16 @@
|
||||
|
||||
class TeamExecutive : public Employee
|
||||
{
|
||||
TeamExecutive() = default;
|
||||
TeamExecutive(
|
||||
const std::string& password,
|
||||
const std::string& name,
|
||||
const std::string& phone,
|
||||
const std::string& email,
|
||||
const std::string& teamId,
|
||||
std::shared_ptr<Payroll> payroll
|
||||
) :Employee(password, name, phone, email, teamId, Enums::EmployeeType::GENERAL, payroll) {
|
||||
};
|
||||
~TeamExecutive() = default;
|
||||
};
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#include "Ticket.h"
|
||||
|
||||
int Ticket::m_tid = 0;
|
||||
|
||||
const std::string& Ticket::getTicketId() const
|
||||
{
|
||||
return m_id;
|
||||
|
||||
@@ -5,19 +5,20 @@
|
||||
class Ticket
|
||||
{
|
||||
private:
|
||||
static int m_tid;
|
||||
std::string m_id;
|
||||
Enums::TicketType m_type;
|
||||
std::string m_description;
|
||||
Enums::TicketStatus m_status;
|
||||
std::string m_employeeId;
|
||||
public:
|
||||
Ticket() : m_id(""), m_type(Enums::TicketType::UNKNOWN), m_description(""), m_status(Enums::TicketStatus::OPEN), m_employeeId("") {}
|
||||
Ticket(const std::string& id,
|
||||
Ticket() : m_id("TKT" + std::to_string(++m_tid)), m_type(Enums::TicketType::UNKNOWN), m_description(""), m_status(Enums::TicketStatus::OPEN), m_employeeId("") {}
|
||||
Ticket(
|
||||
Enums::TicketType type,
|
||||
const std::string& description,
|
||||
const std::string& employeeId,
|
||||
Enums::TicketStatus status)
|
||||
: m_id(id), m_type(type), m_description(description), m_status(status), m_employeeId(employeeId) {}
|
||||
: m_id("TKT" + std::to_string(++m_tid)), m_type(type), m_description(description), m_status(status), m_employeeId(employeeId) {}
|
||||
const std::string& getTicketId() const;
|
||||
Enums::TicketType getTicketType() const;
|
||||
const std::string& getDescription() const;
|
||||
|
||||
@@ -6,4 +6,33 @@ namespace Config
|
||||
{
|
||||
constexpr const char* DEFAULT_PASSWORD = "password";
|
||||
}
|
||||
|
||||
namespace Payroll
|
||||
{
|
||||
constexpr double TEAM_LEAD_BASIC_SALARY = 0.0;
|
||||
constexpr double TEAM_LEAD_HOUSE_RENT_ALLOWANCE = 0.0;
|
||||
constexpr double TEAM_LEAD_FOOD_ALLOWANCE = 0.0;
|
||||
constexpr double TEAM_LEAD_EMPLOYEE_PF_CONTRIBUTION = 0.0;
|
||||
constexpr double TEAM_LEAD_EMPLOYER_PF_CONTRIBUTION = 0.0;
|
||||
constexpr double SENIOR_BASIC_SALARY = 0.0;
|
||||
constexpr double SENIOR_HOUSE_RENT_ALLOWANCE = 0.0;
|
||||
constexpr double SENIOR_FOOD_ALLOWANCE = 0.0;
|
||||
constexpr double SENIOR_EMPLOYEE_PF_CONTRIBUTION = 0.0;
|
||||
constexpr double SENIOR_EMPLOYER_PF_CONTRIBUTION = 0.0;
|
||||
constexpr double JUNIOR_BASIC_SALARY = 0.0;
|
||||
constexpr double JUNIOR_HOUSE_RENT_ALLOWANCE = 0.0;
|
||||
constexpr double JUNIOR_FOOD_ALLOWANCE = 0.0;
|
||||
constexpr double JUNIOR_EMPLOYEE_PF_CONTRIBUTION = 0.0;
|
||||
constexpr double JUNIOR_EMPLOYER_PF_CONTRIBUTION = 0.0;
|
||||
constexpr double HR_MANAGER_BASIC_SALARY = 0.0;
|
||||
constexpr double HR_MANAGER_HOUSE_RENT_ALLOWANCE = 0.0;
|
||||
constexpr double HR_MANAGER_FOOD_ALLOWANCE = 0.0;
|
||||
constexpr double HR_MANAGER_EMPLOYEE_PF_CONTRIBUTION = 0.0;
|
||||
constexpr double HR_MANAGER_EMPLOYER_PF_CONTRIBUTION = 0.0;
|
||||
constexpr double EXECUTIVE_BASIC_SALARY = 0.0;
|
||||
constexpr double EXECUTIVE_HOUSE_RENT_ALLOWANCE = 0.0;
|
||||
constexpr double EXECUTIVE_FOOD_ALLOWANCE = 0.0;
|
||||
constexpr double EXECUTIVE_EMPLOYEE_PF_CONTRIBUTION = 0.0;
|
||||
constexpr double EXECUTIVE_EMPLOYER_PF_CONTRIBUTION = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
#include "EmployeeManagememtService.h"
|
||||
@@ -1,5 +0,0 @@
|
||||
#pragma once
|
||||
class EmployeeManagememtService
|
||||
{
|
||||
};
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
#include "EmployeeManagementService.h"
|
||||
|
||||
void EmployeeManagementService::createEmployee(Enums::EmployeeType, const std::string& email, const std::string& password, const std::string& name, const std::string& phone)
|
||||
{
|
||||
}
|
||||
|
||||
bool EmployeeManagementService::deactivateEmployee(const std::string& id)
|
||||
{
|
||||
}
|
||||
|
||||
Employees EmployeeManagementService::getEmployees()
|
||||
{
|
||||
}
|
||||
|
||||
std::shared_ptr<const Employee> EmployeeManagementService::getEmployee(const std::string& id)
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
#pragma once
|
||||
#include <vector>
|
||||
#include <tuple>
|
||||
#include "DataStore.h"
|
||||
#include "Enums.h"
|
||||
|
||||
using Employees = std::vector<std::shared_ptr<const Employee>>;
|
||||
|
||||
class EmployeeManagementService
|
||||
{
|
||||
private:
|
||||
DataStore& m_dataStore;
|
||||
public:
|
||||
EmployeeManagementService() : m_dataStore(DataStore::getInstance()) {};
|
||||
void createEmployee(Enums::EmployeeType, const std::string&, const std::string&, const std::string&, const std::string&);
|
||||
bool deactivateEmployee(const std::string&);
|
||||
Employees getEmployees();
|
||||
std::shared_ptr<const Employee> getEmployee(const std::string&);
|
||||
};
|
||||
@@ -1,5 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
class PayslipManagementService
|
||||
{
|
||||
private:
|
||||
DataStore& m_dataStore;
|
||||
public:
|
||||
PayslipManagementService() : m_dataStore(DataStore::getInstance()) {};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user