Set up codebase
- Define models, factory classes, data store, utility classes (timestamp, io helpers, enums, validator) - Define Model Class Structures - Add new model Log - Add new service LogService - Add Factory class - Add Utilities like Timestamp, Validator, Input/Output Helpers.. Co-authored-by: Tinu Johnson <tinu.johnson@trenser.com> Co-authored-by: Princy Jerin <princy.jerin@trenser.com> Co-authored-by: Ajmal Jalaludeen <ajmal.jalaludeen@trenser.com> Co-authored-by: Jissin Sam Mathew <jissin.mathew@trenser.com>
This commit is contained in:
@@ -102,6 +102,7 @@
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)controllers;$(ProjectDir)services;$(ProjectDir)utilities;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
@@ -123,6 +124,9 @@
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="controllers\ZenvyController.cpp" />
|
||||
<ClCompile Include="datastores\DataStore.cpp" />
|
||||
<ClCompile Include="factories\Factory.cpp" />
|
||||
<ClCompile Include="models\Announcement.cpp" />
|
||||
<ClCompile Include="models\Attendance.cpp" />
|
||||
<ClCompile Include="models\Booking.cpp" />
|
||||
@@ -132,6 +136,7 @@
|
||||
<ClCompile Include="models\ITExecutive.cpp" />
|
||||
<ClCompile Include="models\JobListing.cpp" />
|
||||
<ClCompile Include="models\Leave.cpp" />
|
||||
<ClCompile Include="models\Log.cpp" />
|
||||
<ClCompile Include="models\Notification.cpp" />
|
||||
<ClCompile Include="models\Payroll.cpp" />
|
||||
<ClCompile Include="models\Payslip.cpp" />
|
||||
@@ -145,6 +150,7 @@
|
||||
<ClCompile Include="services\BookingManagementService.cpp" />
|
||||
<ClCompile Include="services\EmployeeManagememtService.cpp" />
|
||||
<ClCompile Include="services\LeaveManagementService.cpp" />
|
||||
<ClCompile Include="services\LogService.cpp" />
|
||||
<ClCompile Include="services\NotificationManagementService.cpp" />
|
||||
<ClCompile Include="services\PayslipManagementService.cpp" />
|
||||
<ClCompile Include="services\TalentAcquisitionManagementService.cpp" />
|
||||
@@ -154,8 +160,16 @@
|
||||
<ClCompile Include="models\Employee.cpp" />
|
||||
<ClCompile Include="models\HRManager.cpp" />
|
||||
<ClCompile Include="Trenser.Zenvy.cpp" />
|
||||
<ClCompile Include="utilities\Enums.cpp" />
|
||||
<ClCompile Include="utilities\InputHelper.cpp" />
|
||||
<ClCompile Include="utilities\OutputHelper.cpp" />
|
||||
<ClCompile Include="utilities\Timestamp.cpp" />
|
||||
<ClCompile Include="utilities\Validator.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="controllers\ZenvyController.h" />
|
||||
<ClInclude Include="datastores\DataStore.h" />
|
||||
<ClInclude Include="factories\Factory.h" />
|
||||
<ClInclude Include="models\Announcement.h" />
|
||||
<ClInclude Include="models\Attendance.h" />
|
||||
<ClInclude Include="models\Booking.h" />
|
||||
@@ -165,6 +179,7 @@
|
||||
<ClInclude Include="models\ITExecutive.h" />
|
||||
<ClInclude Include="models\JobListing.h" />
|
||||
<ClInclude Include="models\Leave.h" />
|
||||
<ClInclude Include="models\Log.h" />
|
||||
<ClInclude Include="models\Notification.h" />
|
||||
<ClInclude Include="models\Payroll.h" />
|
||||
<ClInclude Include="models\Payslip.h" />
|
||||
@@ -178,11 +193,17 @@
|
||||
<ClInclude Include="services\BookingManagementService.h" />
|
||||
<ClInclude Include="services\EmployeeManagememtService.h" />
|
||||
<ClInclude Include="services\LeaveManagementService.h" />
|
||||
<ClInclude Include="services\LogService.h" />
|
||||
<ClInclude Include="services\NotificationManagementService.h" />
|
||||
<ClInclude Include="services\PayslipManagementService.h" />
|
||||
<ClInclude Include="services\TalentAcquisitionManagementService.h" />
|
||||
<ClInclude Include="services\TeamManagementService.h" />
|
||||
<ClInclude Include="services\TicketManagementService.h" />
|
||||
<ClInclude Include="utilities\Enums.h" />
|
||||
<ClInclude Include="utilities\InputHelper.h" />
|
||||
<ClInclude Include="utilities\OutputHelper.h" />
|
||||
<ClInclude Include="utilities\Timestamp.h" />
|
||||
<ClInclude Include="utilities\Validator.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="models\Admin.h" />
|
||||
|
||||
@@ -19,6 +19,18 @@
|
||||
<Filter Include="Models">
|
||||
<UniqueIdentifier>{62c491e3-6127-40c4-a2d9-fb10b223bb12}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Controllers">
|
||||
<UniqueIdentifier>{e64383cf-bc11-454c-b3ee-b009eff44d92}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Utilities">
|
||||
<UniqueIdentifier>{060093db-4db8-4e52-9337-59364f6b5581}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Factories">
|
||||
<UniqueIdentifier>{d6d09774-b79d-4ec9-a8c5-db90e95350df}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="DataStores">
|
||||
<UniqueIdentifier>{eb93b9d1-08eb-48aa-be2a-e17085ce27bd}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Trenser.Zenvy.cpp">
|
||||
@@ -114,6 +126,36 @@
|
||||
<ClCompile Include="models\Ticket.cpp">
|
||||
<Filter>Models</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="controllers\ZenvyController.cpp">
|
||||
<Filter>Controllers</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="utilities\InputHelper.cpp">
|
||||
<Filter>Utilities</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="utilities\Enums.cpp">
|
||||
<Filter>Utilities</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="utilities\OutputHelper.cpp">
|
||||
<Filter>Utilities</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="utilities\Validator.cpp">
|
||||
<Filter>Utilities</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="utilities\Timestamp.cpp">
|
||||
<Filter>Utilities</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="factories\Factory.cpp">
|
||||
<Filter>Factories</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="datastores\DataStore.cpp">
|
||||
<Filter>DataStores</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="services\LogService.cpp">
|
||||
<Filter>Services</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="models\Log.cpp">
|
||||
<Filter>Models</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="services\AuthenticationManagementService.h">
|
||||
@@ -197,6 +239,36 @@
|
||||
<ClInclude Include="models\Ticket.h">
|
||||
<Filter>Models</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="controllers\ZenvyController.h">
|
||||
<Filter>Controllers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="utilities\InputHelper.h">
|
||||
<Filter>Utilities</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="utilities\Enums.h">
|
||||
<Filter>Utilities</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="utilities\Validator.h">
|
||||
<Filter>Utilities</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="utilities\OutputHelper.h">
|
||||
<Filter>Utilities</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="utilities\Timestamp.h">
|
||||
<Filter>Utilities</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="factories\Factory.h">
|
||||
<Filter>Factories</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="datastores\DataStore.h">
|
||||
<Filter>DataStores</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="services\LogService.h">
|
||||
<Filter>Services</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="models\Log.h">
|
||||
<Filter>Models</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="models\Employee.h">
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
#include "ZenvyController.h"
|
||||
@@ -0,0 +1,5 @@
|
||||
#pragma once
|
||||
class ZenvyController
|
||||
{
|
||||
};
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
#include "DataStore.h"
|
||||
@@ -0,0 +1,5 @@
|
||||
#pragma once
|
||||
class DataStore
|
||||
{
|
||||
};
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
#include "Factory.h"
|
||||
@@ -0,0 +1,13 @@
|
||||
#pragma once
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
|
||||
class Factory
|
||||
{
|
||||
public:
|
||||
template<typename T, typename... Args>
|
||||
static std::shared_ptr<T> getObject(Args&&... args)
|
||||
{
|
||||
return std::make_shared<T>(std::forward<Args>(args)...);
|
||||
}
|
||||
};
|
||||
@@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
#include "Employee.h"
|
||||
|
||||
class Admin : public Employee
|
||||
{
|
||||
};
|
||||
|
||||
@@ -1 +1,31 @@
|
||||
#include "Announcement.h"
|
||||
#include "Announcement.h"
|
||||
|
||||
const std::string& Announcement::getAnnouncementId() const
|
||||
{
|
||||
return m_id;
|
||||
}
|
||||
|
||||
const util::Timestamp& Announcement::getAnnouncementTimestamp() const
|
||||
{
|
||||
return m_timestamp;
|
||||
}
|
||||
|
||||
const std::string& Announcement::getAnnouncementMessage() const
|
||||
{
|
||||
return m_message;
|
||||
}
|
||||
|
||||
void Announcement::setAnnouncementId(const std::string& id)
|
||||
{
|
||||
m_id = id;
|
||||
}
|
||||
|
||||
void Announcement::setAnnouncementTimestamp(const util::Timestamp& timestamp)
|
||||
{
|
||||
m_timestamp = timestamp;
|
||||
}
|
||||
|
||||
void Announcement::setAnnouncementMessage(const std::string& message)
|
||||
{
|
||||
m_message = message;
|
||||
}
|
||||
@@ -1,5 +1,22 @@
|
||||
#pragma once
|
||||
#include <string>
|
||||
#include "Timestamp.h"
|
||||
|
||||
class Announcement
|
||||
{
|
||||
};
|
||||
|
||||
private:
|
||||
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) {}
|
||||
const std::string& getAnnouncementId() const;
|
||||
const util::Timestamp& getAnnouncementTimestamp() const;
|
||||
const std::string& getAnnouncementMessage() const;
|
||||
void setAnnouncementId(const std::string& id);
|
||||
void setAnnouncementTimestamp(const util::Timestamp& timestamp);
|
||||
void setAnnouncementMessage(const std::string& message);
|
||||
};
|
||||
@@ -1 +1,41 @@
|
||||
#include "Attendance.h"
|
||||
|
||||
const std::string& Attendance::getAttendanceId() const
|
||||
{
|
||||
return m_id;
|
||||
}
|
||||
|
||||
const util::Timestamp& Attendance::getLoginTime() const
|
||||
{
|
||||
return m_loginTime;
|
||||
}
|
||||
|
||||
const util::Timestamp& Attendance::getLogoutTime() const
|
||||
{
|
||||
return m_logoutTime;
|
||||
}
|
||||
|
||||
void Attendance::setAttendanceId(const std::string& id)
|
||||
{
|
||||
m_id = id;
|
||||
}
|
||||
|
||||
void Attendance::setLoginTime(const util::Timestamp& loginTime)
|
||||
{
|
||||
m_loginTime = loginTime;
|
||||
}
|
||||
|
||||
void Attendance::setLogoutTime(const util::Timestamp& logoutTime)
|
||||
{
|
||||
m_logoutTime = logoutTime;
|
||||
}
|
||||
|
||||
double Attendance::getWorkingHours() const
|
||||
{
|
||||
return util::Timestamp::getDurationInHours(m_loginTime, m_logoutTime);
|
||||
}
|
||||
|
||||
double Attendance::getWorkingMinutes() const
|
||||
{
|
||||
return util::Timestamp::getDurationInMinutes(m_loginTime, m_logoutTime);
|
||||
}
|
||||
@@ -1,5 +1,25 @@
|
||||
#pragma once
|
||||
#include <string>
|
||||
#include "Timestamp.h"
|
||||
|
||||
class Attendance
|
||||
{
|
||||
};
|
||||
|
||||
private:
|
||||
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,
|
||||
const util::Timestamp& logoutTime)
|
||||
: m_id(id), m_loginTime(loginTime), m_logoutTime(logoutTime) {}
|
||||
const std::string& getAttendanceId() const;
|
||||
const util::Timestamp& getLoginTime() const;
|
||||
const util::Timestamp& getLogoutTime() const;
|
||||
void setAttendanceId(const std::string& id);
|
||||
void setLoginTime(const util::Timestamp& loginTime);
|
||||
void setLogoutTime(const util::Timestamp& logoutTime);
|
||||
double getWorkingHours() const;
|
||||
double getWorkingMinutes() const;
|
||||
};
|
||||
@@ -1 +1,61 @@
|
||||
#include "Booking.h"
|
||||
|
||||
const std::string& Booking::getBookingId() const
|
||||
{
|
||||
return m_id;
|
||||
}
|
||||
|
||||
const util::Timestamp& Booking::getStartTime() const
|
||||
{
|
||||
return m_startTime;
|
||||
}
|
||||
|
||||
const util::Timestamp& Booking::getEndTime() const
|
||||
{
|
||||
return m_endTime;
|
||||
}
|
||||
|
||||
const std::string& Booking::getEmployeeId() const
|
||||
{
|
||||
return m_employeeId;
|
||||
}
|
||||
|
||||
std::shared_ptr<Team> Booking::getTeam() const
|
||||
{
|
||||
return m_team;
|
||||
}
|
||||
|
||||
void Booking::setBookingId(const std::string& id)
|
||||
{
|
||||
m_id = id;
|
||||
}
|
||||
|
||||
void Booking::setStartTime(const util::Timestamp& startTime)
|
||||
{
|
||||
m_startTime = startTime;
|
||||
}
|
||||
|
||||
void Booking::setEndTime(const util::Timestamp& endTime)
|
||||
{
|
||||
m_endTime = endTime;
|
||||
}
|
||||
|
||||
void Booking::setEmployeeId(const std::string& employeeId)
|
||||
{
|
||||
m_employeeId = employeeId;
|
||||
}
|
||||
|
||||
void Booking::setTeam(std::shared_ptr<Team> team)
|
||||
{
|
||||
m_team = team;
|
||||
}
|
||||
|
||||
double Booking::getDurationInHours() const
|
||||
{
|
||||
return util::Timestamp::getDurationInHours(m_startTime, m_endTime);
|
||||
}
|
||||
|
||||
double Booking::getDurationInMinutes() const
|
||||
{
|
||||
return util::Timestamp::getDurationInMinutes(m_startTime, m_endTime);
|
||||
}
|
||||
@@ -1,5 +1,35 @@
|
||||
#pragma once
|
||||
#include <string>
|
||||
#include <memory>
|
||||
#include "Team.h"
|
||||
#include "Timestamp.h"
|
||||
|
||||
class Booking
|
||||
{
|
||||
};
|
||||
|
||||
private:
|
||||
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,
|
||||
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) {}
|
||||
const std::string& getBookingId() const;
|
||||
const util::Timestamp& getStartTime() const;
|
||||
const util::Timestamp& getEndTime() const;
|
||||
const std::string& getEmployeeId() const;
|
||||
std::shared_ptr<Team> getTeam() const;
|
||||
void setBookingId(const std::string& id);
|
||||
void setStartTime(const util::Timestamp& startTime);
|
||||
void setEndTime(const util::Timestamp& endTime);
|
||||
void setEmployeeId(const std::string& employeeId);
|
||||
void setTeam(std::shared_ptr<Team> team);
|
||||
double getDurationInHours() const;
|
||||
double getDurationInMinutes() const;
|
||||
};
|
||||
@@ -1 +1,51 @@
|
||||
#include "Candidate.h"
|
||||
|
||||
const std::string& Candidate::getCandidateId() const
|
||||
{
|
||||
return m_id;
|
||||
}
|
||||
|
||||
const std::string& Candidate::getCandidateName() const
|
||||
{
|
||||
return m_name;
|
||||
}
|
||||
|
||||
long int Candidate::getCandidatePhone() const
|
||||
{
|
||||
return m_phone;
|
||||
}
|
||||
|
||||
const std::string& Candidate::getCandidateQualification() const
|
||||
{
|
||||
return m_qualification;
|
||||
}
|
||||
|
||||
Enums::CandidateStatus Candidate::getCandidateStatus() const
|
||||
{
|
||||
return m_status;
|
||||
}
|
||||
|
||||
void Candidate::setCandidateId(const std::string& id)
|
||||
{
|
||||
m_id = id;
|
||||
}
|
||||
|
||||
void Candidate::setCandidateName(const std::string& name)
|
||||
{
|
||||
m_name = name;
|
||||
}
|
||||
|
||||
void Candidate::setCandidatePhone(long int phone)
|
||||
{
|
||||
m_phone = phone;
|
||||
}
|
||||
|
||||
void Candidate::setCandidateQualification(const std::string& qualification)
|
||||
{
|
||||
m_qualification = qualification;
|
||||
}
|
||||
|
||||
void Candidate::setCandidateStatus(Enums::CandidateStatus status)
|
||||
{
|
||||
m_status = status;
|
||||
}
|
||||
@@ -1,5 +1,31 @@
|
||||
#pragma once
|
||||
#include <string>
|
||||
#include "Enums.h"
|
||||
|
||||
class Candidate
|
||||
{
|
||||
};
|
||||
|
||||
private:
|
||||
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,
|
||||
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) {}
|
||||
const std::string& getCandidateId() const;
|
||||
const std::string& getCandidateName() const;
|
||||
long int getCandidatePhone() const;
|
||||
const std::string& getCandidateQualification() const;
|
||||
Enums::CandidateStatus getCandidateStatus() const;
|
||||
void setCandidateId(const std::string& id);
|
||||
void setCandidateName(const std::string& name);
|
||||
void setCandidatePhone(long int phone);
|
||||
void setCandidateQualification(const std::string& qualification);
|
||||
void setCandidateStatus(Enums::CandidateStatus status);
|
||||
};
|
||||
@@ -1 +1,125 @@
|
||||
#include "Employee.h"
|
||||
|
||||
const std::string& Employee::getEmployeeId() const
|
||||
{
|
||||
return m_id;
|
||||
}
|
||||
|
||||
const std::string& Employee::getEmployeePassword() const
|
||||
{
|
||||
return m_password;
|
||||
}
|
||||
|
||||
const std::string& Employee::getEmployeeName() const
|
||||
{
|
||||
return m_name;
|
||||
}
|
||||
|
||||
const std::string& Employee::getEmployeePhone() const
|
||||
{
|
||||
return m_phone;
|
||||
}
|
||||
|
||||
const std::string& Employee::getEmployeeEmail() const
|
||||
{
|
||||
return m_email;
|
||||
}
|
||||
|
||||
Enums::AccountStatus Employee::getEmployeeAccountStatus() const
|
||||
{
|
||||
return m_accountStatus;
|
||||
}
|
||||
|
||||
Enums::TeamStatus Employee::getEmployeeTeamStatus() const
|
||||
{
|
||||
return m_teamStatus;
|
||||
}
|
||||
|
||||
const std::string& Employee::getEmployeeTeamId() const
|
||||
{
|
||||
return m_teamId;
|
||||
}
|
||||
|
||||
std::shared_ptr<Payroll> Employee::getPayroll() const
|
||||
{
|
||||
return m_payroll;
|
||||
}
|
||||
|
||||
const payslipMap& Employee::getEmployeePayslips() const
|
||||
{
|
||||
return m_payslips;
|
||||
}
|
||||
|
||||
const attendanceMap& Employee::getEmployeeAttendances() const
|
||||
{
|
||||
return m_attendances;
|
||||
}
|
||||
|
||||
const leaveMap& Employee::getEmployeeLeaves() const
|
||||
{
|
||||
return m_leaves;
|
||||
}
|
||||
|
||||
void Employee::setEmployeeId(const std::string& id)
|
||||
{
|
||||
m_id = id;
|
||||
}
|
||||
|
||||
void Employee::setEmployeePassword(const std::string& password)
|
||||
{
|
||||
m_password = password;
|
||||
}
|
||||
|
||||
void Employee::setEmployeeName(const std::string& name)
|
||||
{
|
||||
m_name = name;
|
||||
}
|
||||
|
||||
void Employee::setEmployeePhone(const std::string& phone)
|
||||
{
|
||||
m_phone = phone;
|
||||
}
|
||||
|
||||
void Employee::setEmployeeAccountStatus(Enums::AccountStatus status)
|
||||
{
|
||||
m_accountStatus = status;
|
||||
}
|
||||
|
||||
void Employee::setEmployeeTeamStatus(Enums::TeamStatus status)
|
||||
{
|
||||
m_teamStatus = status;
|
||||
}
|
||||
|
||||
void Employee::setEmployeeTeamId(const std::string& teamId)
|
||||
{
|
||||
m_teamId = teamId;
|
||||
}
|
||||
|
||||
void Employee::setEmployeePayroll(std::shared_ptr<Payroll> payroll)
|
||||
{
|
||||
m_payroll = payroll;
|
||||
}
|
||||
|
||||
void Employee::addPayslip(std::shared_ptr<Payslip> payslip)
|
||||
{
|
||||
if (payslip)
|
||||
{
|
||||
m_payslips[payslip->getPayslipId()] = payslip;
|
||||
}
|
||||
}
|
||||
|
||||
void Employee::addAttendance(std::shared_ptr<Attendance> attendance)
|
||||
{
|
||||
if (attendance)
|
||||
{
|
||||
m_attendances[attendance->getLoginTime().getDateAsInt()][attendance->getAttendanceId()] = attendance;
|
||||
}
|
||||
}
|
||||
|
||||
void Employee::addLeave(std::shared_ptr<Leave> leave)
|
||||
{
|
||||
if (leave)
|
||||
{
|
||||
m_leaves[leave->getLeaveId()] = leave;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,63 @@
|
||||
#pragma once
|
||||
#include <string>
|
||||
#include <memory>
|
||||
#include <map>
|
||||
#include "Payslip.h"
|
||||
#include "Attendance.h"
|
||||
#include "Leave.h"
|
||||
#include "Payroll.h"
|
||||
#include "Enums.h"
|
||||
using payslipMap = std::map<std::string, std::shared_ptr<Payslip>>;
|
||||
using attendanceMap = std::map<int, std::map<std::string, std::shared_ptr<Attendance>>>;
|
||||
using leaveMap = std::map<std::string, std::shared_ptr<Leave>>;
|
||||
|
||||
class Employee
|
||||
{
|
||||
};
|
||||
|
||||
private:
|
||||
std::string m_id;
|
||||
std::string m_password;
|
||||
std::string m_name;
|
||||
std::string m_phone;
|
||||
std::string m_email;
|
||||
Enums::AccountStatus m_accountStatus;
|
||||
Enums::TeamStatus m_teamStatus;
|
||||
std::string m_teamId;
|
||||
std::shared_ptr<Payroll> m_payroll;
|
||||
payslipMap m_payslips;
|
||||
attendanceMap m_attendances;
|
||||
leaveMap m_leaves;
|
||||
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("") {}
|
||||
Employee(const std::string& id,
|
||||
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)
|
||||
: 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_payroll(payroll) {}
|
||||
const std::string& getEmployeeId() const;
|
||||
const std::string& getEmployeePassword() const;
|
||||
const std::string& getEmployeeName() const;
|
||||
const std::string& getEmployeePhone() const;
|
||||
const std::string& getEmployeeEmail() const;
|
||||
Enums::AccountStatus getEmployeeAccountStatus() const;
|
||||
Enums::TeamStatus getEmployeeTeamStatus() const;
|
||||
const std::string& getEmployeeTeamId() const;
|
||||
std::shared_ptr<Payroll> getPayroll() const;
|
||||
const payslipMap& getEmployeePayslips() const;
|
||||
const attendanceMap& getEmployeeAttendances() const;
|
||||
const leaveMap& getEmployeeLeaves() const;
|
||||
void setEmployeeId(const std::string& id);
|
||||
void setEmployeePassword(const std::string& password);
|
||||
void setEmployeeName(const std::string& name);
|
||||
void setEmployeePhone(const std::string& phone);
|
||||
void setEmployeeAccountStatus(Enums::AccountStatus status);
|
||||
void setEmployeeTeamStatus(Enums::TeamStatus status);
|
||||
void setEmployeeTeamId(const std::string& teamId);
|
||||
void setEmployeePayroll(std::shared_ptr<Payroll> payroll);
|
||||
void addPayslip(std::shared_ptr<Payslip> payslip);
|
||||
void addAttendance(std::shared_ptr<Attendance> attendance);
|
||||
void addLeave(std::shared_ptr<Leave> leave);
|
||||
~Employee() = default;
|
||||
};
|
||||
@@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
#include "Employee.h"
|
||||
|
||||
class FinanceExecutive : public Employee
|
||||
{
|
||||
};
|
||||
|
||||
@@ -1 +1,11 @@
|
||||
#include "GeneralEmployee.h"
|
||||
#include "GeneralEmployee.h"
|
||||
|
||||
Enums::EmployeeDesignation GeneralEmployee::getDesignation() const
|
||||
{
|
||||
return m_designation;
|
||||
}
|
||||
|
||||
void GeneralEmployee::setDesignation(Enums::EmployeeDesignation designation)
|
||||
{
|
||||
m_designation = designation;
|
||||
}
|
||||
@@ -1,5 +1,23 @@
|
||||
#pragma once
|
||||
#include "Employee.h"
|
||||
#include "Enums.h"
|
||||
|
||||
class GeneralEmployee : public Employee
|
||||
{
|
||||
};
|
||||
private:
|
||||
Enums::EmployeeDesignation m_designation;
|
||||
public:
|
||||
GeneralEmployee() : m_designation(Enums::EmployeeDesignation::JUNIOR) {}
|
||||
GeneralEmployee(const std::string& id,
|
||||
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,
|
||||
Enums::EmployeeDesignation designation)
|
||||
: Employee(id, password, name, phone, email, teamId, payroll), m_designation(designation) {}
|
||||
Enums::EmployeeDesignation getDesignation() const;
|
||||
void setDesignation(Enums::EmployeeDesignation designation);
|
||||
~GeneralEmployee() = default;
|
||||
};
|
||||
@@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
#include "Employee.h"
|
||||
|
||||
class HRManager : public Employee
|
||||
{
|
||||
};
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
#include "Employee.h"
|
||||
|
||||
class ITExecutive : public Employee
|
||||
{
|
||||
};
|
||||
|
||||
@@ -1 +1,61 @@
|
||||
#include "JobListing.h"
|
||||
#include "JobListing.h"
|
||||
|
||||
const std::string& JobListing::getJobId() const
|
||||
{
|
||||
return m_id;
|
||||
}
|
||||
|
||||
const std::string& JobListing::getJobName() const
|
||||
{
|
||||
return m_name;
|
||||
}
|
||||
|
||||
const std::string& JobListing::getJobDescription() const
|
||||
{
|
||||
return m_description;
|
||||
}
|
||||
|
||||
Enums::JobListingStatus JobListing::getJobStatus() const
|
||||
{
|
||||
return m_status;
|
||||
}
|
||||
|
||||
int JobListing::getNumberOfVacancies() const
|
||||
{
|
||||
return m_numberOfVacancies;
|
||||
}
|
||||
|
||||
const candidateMap& JobListing::getCandidates() const
|
||||
{
|
||||
return m_candidates;
|
||||
}
|
||||
|
||||
void JobListing::setJobId(const std::string& id)
|
||||
{
|
||||
m_id = id;
|
||||
}
|
||||
|
||||
void JobListing::setJobName(const std::string& name)
|
||||
{
|
||||
m_name = name;
|
||||
}
|
||||
|
||||
void JobListing::setJobDescription(const std::string& description)
|
||||
{
|
||||
m_description = description;
|
||||
}
|
||||
|
||||
void JobListing::setJobStatus(Enums::JobListingStatus status)
|
||||
{
|
||||
m_status = status;
|
||||
}
|
||||
|
||||
void JobListing::setNumberOfVacancies(int numberOfVacancies)
|
||||
{
|
||||
m_numberOfVacancies = numberOfVacancies;
|
||||
}
|
||||
|
||||
void JobListing::setCandidates(const candidateMap& candidates)
|
||||
{
|
||||
m_candidates = candidates;
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
#pragma once
|
||||
#include <string>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include "Candidate.h"
|
||||
#include "Enums.h"
|
||||
using candidateMap = std::map<std::string, std::shared_ptr<Candidate>>;
|
||||
|
||||
class JobListing
|
||||
{
|
||||
private:
|
||||
std::string m_id;
|
||||
std::string m_name;
|
||||
std::string m_description;
|
||||
Enums::JobListingStatus m_status;
|
||||
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,
|
||||
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) {}
|
||||
const std::string& getJobId() const;
|
||||
const std::string& getJobName() const;
|
||||
const std::string& getJobDescription() const;
|
||||
Enums::JobListingStatus getJobStatus() const;
|
||||
int getNumberOfVacancies() const;
|
||||
const candidateMap& getCandidates() const;
|
||||
void setJobId(const std::string& id);
|
||||
void setJobName(const std::string& name);
|
||||
void setJobDescription(const std::string& description);
|
||||
void setJobStatus(Enums::JobListingStatus status);
|
||||
void setNumberOfVacancies(int numberOfVacancies);
|
||||
void setCandidates(const candidateMap& candidates);
|
||||
};
|
||||
@@ -1 +1,87 @@
|
||||
#include "Leave.h"
|
||||
|
||||
const std::string& Leave::getLeaveId() const
|
||||
{
|
||||
return m_id;
|
||||
}
|
||||
|
||||
const std::string& Leave::getEmployeeId() const
|
||||
{
|
||||
return m_employeeId;
|
||||
}
|
||||
|
||||
const util::Timestamp& Leave::getTimestamp() const
|
||||
{
|
||||
return m_timestamp;
|
||||
}
|
||||
|
||||
const std::string& Leave::getLeaveReason() const
|
||||
{
|
||||
return m_reason;
|
||||
}
|
||||
|
||||
int Leave::getNumberOfGeneralLeave()
|
||||
{
|
||||
return m_numberOfGeneralLeave;
|
||||
}
|
||||
|
||||
int Leave::getNumberOfRestrictedLeave()
|
||||
{
|
||||
return m_numberOfRestrictedLeave;
|
||||
}
|
||||
|
||||
int Leave::getNumberOfMedicalLeave()
|
||||
{
|
||||
return m_numberOfMedicalLeave;
|
||||
}
|
||||
|
||||
Enums::LeaveType Leave::getLeaveType() const
|
||||
{
|
||||
return m_leaveType;
|
||||
}
|
||||
|
||||
void Leave::setLeaveId(const std::string& id)
|
||||
{
|
||||
m_id = id;
|
||||
}
|
||||
|
||||
void Leave::setEmployeeId(const std::string& employeeId)
|
||||
{
|
||||
m_employeeId = employeeId;
|
||||
}
|
||||
|
||||
void Leave::setTimestamp(const util::Timestamp& timestamp)
|
||||
{
|
||||
m_timestamp = timestamp;
|
||||
}
|
||||
|
||||
void Leave::setLeaveReason(const std::string& reason)
|
||||
{
|
||||
m_reason = reason;
|
||||
}
|
||||
|
||||
void Leave::setNumberOfGeneralLeave(int value)
|
||||
{
|
||||
m_numberOfGeneralLeave = value;
|
||||
}
|
||||
|
||||
void Leave::setNumberOfRestrictedLeave(int value)
|
||||
{
|
||||
m_numberOfRestrictedLeave = value;
|
||||
}
|
||||
|
||||
void Leave::setNumberOfMedicalLeave(int value)
|
||||
{
|
||||
m_numberOfMedicalLeave = value;
|
||||
}
|
||||
|
||||
void Leave::setLeaveType(Enums::LeaveType type)
|
||||
{
|
||||
m_leaveType = type;
|
||||
}
|
||||
|
||||
int Leave::m_numberOfGeneralLeave = 12;
|
||||
|
||||
int Leave::m_numberOfRestrictedLeave = 2;
|
||||
|
||||
int Leave::m_numberOfMedicalLeave = 6;
|
||||
@@ -1,5 +1,41 @@
|
||||
#pragma once
|
||||
#include <string>
|
||||
#include "Enums.h"
|
||||
#include "Timestamp.h"
|
||||
|
||||
class Leave
|
||||
{
|
||||
};
|
||||
|
||||
private:
|
||||
std::string m_id;
|
||||
std::string m_employeeId;
|
||||
util::Timestamp m_timestamp;
|
||||
std::string m_reason;
|
||||
static int m_numberOfGeneralLeave;
|
||||
static int m_numberOfRestrictedLeave;
|
||||
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,
|
||||
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) {}
|
||||
const std::string& getLeaveId() const;
|
||||
const std::string& getEmployeeId() const;
|
||||
const util::Timestamp& getTimestamp() const;
|
||||
const std::string& getLeaveReason() const;
|
||||
static int getNumberOfGeneralLeave();
|
||||
static int getNumberOfRestrictedLeave();
|
||||
static int getNumberOfMedicalLeave();
|
||||
Enums::LeaveType getLeaveType() const;
|
||||
void setLeaveId(const std::string& id);
|
||||
void setEmployeeId(const std::string& employeeId);
|
||||
void setTimestamp(const util::Timestamp& timestamp);
|
||||
void setLeaveReason(const std::string& reason);
|
||||
void setNumberOfGeneralLeave(int value);
|
||||
void setNumberOfRestrictedLeave(int value);
|
||||
void setNumberOfMedicalLeave(int value);
|
||||
void setLeaveType(Enums::LeaveType type);
|
||||
};
|
||||
@@ -0,0 +1,21 @@
|
||||
#include "Log.h"
|
||||
|
||||
const util::Timestamp& Log::getTimestamp() const
|
||||
{
|
||||
return m_timestamp;
|
||||
}
|
||||
|
||||
const std::string& Log::getMessage() const
|
||||
{
|
||||
return m_message;
|
||||
}
|
||||
|
||||
void Log::setTimestamp(const util::Timestamp& timestamp)
|
||||
{
|
||||
m_timestamp = timestamp;
|
||||
}
|
||||
|
||||
void Log::setMessage(const std::string& message)
|
||||
{
|
||||
m_message = message;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
#pragma once
|
||||
#include <string>
|
||||
#include "Timestamp.h"
|
||||
|
||||
class Log
|
||||
{
|
||||
private:
|
||||
util::Timestamp m_timestamp;
|
||||
std::string m_message;
|
||||
public:
|
||||
Log() : m_timestamp(), m_message("") {}
|
||||
Log(const util::Timestamp& timestamp, const std::string& message)
|
||||
: m_timestamp(timestamp), m_message(message) {}
|
||||
const util::Timestamp& getTimestamp() const;
|
||||
const std::string& getMessage() const;
|
||||
void setTimestamp(const util::Timestamp& timestamp);
|
||||
void setMessage(const std::string& message);
|
||||
};
|
||||
@@ -1 +1,51 @@
|
||||
#include "Notification.h"
|
||||
#include "Notification.h"
|
||||
|
||||
const std::string& Notification::getNotificationId() const
|
||||
{
|
||||
return m_id;
|
||||
}
|
||||
|
||||
const std::string& Notification::getEmployeeId() const
|
||||
{
|
||||
return m_employeeId;
|
||||
}
|
||||
|
||||
const std::string& Notification::getNotificationMessage() const
|
||||
{
|
||||
return m_message;
|
||||
}
|
||||
|
||||
const util::Timestamp& Notification::getNotificationTimestamp() const
|
||||
{
|
||||
return m_timestamp;
|
||||
}
|
||||
|
||||
Enums::NotificationStatus Notification::getNotificationStatus() const
|
||||
{
|
||||
return m_notificationStatus;
|
||||
}
|
||||
|
||||
void Notification::setNotificationId(const std::string& id)
|
||||
{
|
||||
m_id = id;
|
||||
}
|
||||
|
||||
void Notification::setEmployeeId(const std::string& employeeId)
|
||||
{
|
||||
m_employeeId = employeeId;
|
||||
}
|
||||
|
||||
void Notification::setNotificationMessage(const std::string& message)
|
||||
{
|
||||
m_message = message;
|
||||
}
|
||||
|
||||
void Notification::setNotificationTimestamp(const util::Timestamp& timestamp)
|
||||
{
|
||||
m_timestamp = timestamp;
|
||||
}
|
||||
|
||||
void Notification::setNotificationStatus(Enums::NotificationStatus status)
|
||||
{
|
||||
m_notificationStatus = status;
|
||||
}
|
||||
@@ -1,5 +1,31 @@
|
||||
#pragma once
|
||||
#include <string>
|
||||
#include "Enums.h"
|
||||
#include "Timestamp.h"
|
||||
|
||||
class Notification
|
||||
{
|
||||
};
|
||||
|
||||
private:
|
||||
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,
|
||||
const std::string& message,
|
||||
Enums::NotificationStatus notificationStatus)
|
||||
: m_id(id), m_employeeId(employeeId), m_message(message), m_notificationStatus(notificationStatus) {}
|
||||
const std::string& getNotificationId() const;
|
||||
const std::string& getEmployeeId() const;
|
||||
const std::string& getNotificationMessage() const;
|
||||
const util::Timestamp& getNotificationTimestamp() const;
|
||||
Enums::NotificationStatus getNotificationStatus() const;
|
||||
void setNotificationId(const std::string& id);
|
||||
void setEmployeeId(const std::string& employeeId);
|
||||
void setNotificationMessage(const std::string& message);
|
||||
void setNotificationTimestamp(const util::Timestamp& timestamp);
|
||||
void setNotificationStatus(Enums::NotificationStatus status);
|
||||
};
|
||||
@@ -1 +1,56 @@
|
||||
#include "Payroll.h"
|
||||
|
||||
const std::string& Payroll::getPayrollId() const
|
||||
{
|
||||
return m_id;
|
||||
}
|
||||
|
||||
double Payroll::getBasicSalary() const
|
||||
{
|
||||
return m_basicSalary;
|
||||
}
|
||||
|
||||
double Payroll::getHouseRentAllowance() const
|
||||
{
|
||||
return m_houseRentAllowance;
|
||||
}
|
||||
|
||||
double Payroll::getFoodAllowance() const
|
||||
{
|
||||
return m_foodAllowance;
|
||||
}
|
||||
|
||||
double Payroll::getEmployeePFContribution() const
|
||||
{
|
||||
return m_employeePFContribution;
|
||||
}
|
||||
|
||||
double Payroll::getEmployerPFContribution() const
|
||||
{
|
||||
return m_employerPFContribution;
|
||||
}
|
||||
|
||||
void Payroll::setPayrollID(const std::string& id)
|
||||
{
|
||||
m_id = id;
|
||||
}
|
||||
|
||||
void Payroll::setHouseRentAllowance(double value)
|
||||
{
|
||||
m_houseRentAllowance = value;
|
||||
}
|
||||
|
||||
void Payroll::setFoodAllowance(double value)
|
||||
{
|
||||
m_foodAllowance = value;
|
||||
}
|
||||
|
||||
void Payroll::setEmployeePFContribution(double value)
|
||||
{
|
||||
m_employeePFContribution = value;
|
||||
}
|
||||
|
||||
void Payroll::setEmployerPFContribution(double value)
|
||||
{
|
||||
m_employerPFContribution = value;
|
||||
}
|
||||
@@ -1,5 +1,33 @@
|
||||
#pragma once
|
||||
#include <string>
|
||||
|
||||
class Payroll
|
||||
{
|
||||
};
|
||||
|
||||
private:
|
||||
std::string m_id;
|
||||
double m_basicSalary;
|
||||
double m_houseRentAllowance;
|
||||
double m_foodAllowance;
|
||||
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,
|
||||
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) {}
|
||||
const std::string& getPayrollId() const;
|
||||
double getBasicSalary() const;
|
||||
double getHouseRentAllowance() const;
|
||||
double getFoodAllowance() const;
|
||||
double getEmployeePFContribution() const;
|
||||
double getEmployerPFContribution() const;
|
||||
void setPayrollID(const std::string& id);
|
||||
void setHouseRentAllowance(double value);
|
||||
void setFoodAllowance(double value);
|
||||
void setEmployeePFContribution(double value);
|
||||
void setEmployerPFContribution(double value);
|
||||
};
|
||||
@@ -1 +1,21 @@
|
||||
#include "Payslip.h"
|
||||
|
||||
const std::string& Payslip::getPayslipId() const
|
||||
{
|
||||
return m_id;
|
||||
}
|
||||
|
||||
double Payslip::getSalary() const
|
||||
{
|
||||
return m_salary;
|
||||
}
|
||||
|
||||
void Payslip::setPayslipId(const std::string& id)
|
||||
{
|
||||
m_id = id;
|
||||
}
|
||||
|
||||
void Payslip::setSalary(double salary)
|
||||
{
|
||||
m_salary = salary;
|
||||
}
|
||||
@@ -1,5 +1,16 @@
|
||||
#pragma once
|
||||
#include <string>
|
||||
|
||||
class Payslip
|
||||
{
|
||||
};
|
||||
|
||||
private:
|
||||
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) {}
|
||||
const std::string& getPayslipId() const;
|
||||
double getSalary() const;
|
||||
void setPayslipId(const std::string& id);
|
||||
void setSalary(double salary);
|
||||
};
|
||||
@@ -1 +1,34 @@
|
||||
#include "Room.h"
|
||||
|
||||
const std::string& Room::getRoomId() const
|
||||
{
|
||||
return m_id;
|
||||
}
|
||||
|
||||
const std::string& Room::getRoomName() const
|
||||
{
|
||||
return m_name;
|
||||
}
|
||||
|
||||
const bookingMap& Room::getBookings() const
|
||||
{
|
||||
return m_bookings;
|
||||
}
|
||||
|
||||
void Room::setRoomId(const std::string& id)
|
||||
{
|
||||
m_id = id;
|
||||
}
|
||||
|
||||
void Room::setRoomName(const std::string& name)
|
||||
{
|
||||
m_name = name;
|
||||
}
|
||||
|
||||
void Room::addBooking(std::shared_ptr<Booking> booking)
|
||||
{
|
||||
if (booking)
|
||||
{
|
||||
m_bookings[booking->getBookingId()] = booking;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,23 @@
|
||||
#pragma once
|
||||
#include <string>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include "Booking.h"
|
||||
using bookingMap = std::map<std::string, std::shared_ptr<Booking>>;
|
||||
|
||||
class Room
|
||||
{
|
||||
};
|
||||
|
||||
private:
|
||||
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) {}
|
||||
const std::string& getRoomId() const;
|
||||
const std::string& getRoomName() const;
|
||||
const bookingMap& getBookings() const;
|
||||
void setRoomId(const std::string& id);
|
||||
void setRoomName(const std::string& name);
|
||||
void addBooking(std::shared_ptr<Booking> booking);
|
||||
};
|
||||
@@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
#include "Employee.h"
|
||||
|
||||
class TalentExecutive : public Employee
|
||||
{
|
||||
};
|
||||
|
||||
@@ -1 +1,51 @@
|
||||
#include "Team.h"
|
||||
|
||||
const std::string& Team::getTeamId() const
|
||||
{
|
||||
return m_id;
|
||||
}
|
||||
|
||||
const std::string& Team::getTeamName() const
|
||||
{
|
||||
return m_name;
|
||||
}
|
||||
|
||||
std::shared_ptr<Employee> Team::getTeamLead() const
|
||||
{
|
||||
return m_lead;
|
||||
}
|
||||
|
||||
const employeeMap& Team::getEmployeesInTeam() const
|
||||
{
|
||||
return m_employees;
|
||||
}
|
||||
|
||||
int Team::getMaximumNumberOfEmployeesInTeam() const
|
||||
{
|
||||
return m_maximumNumberOfEmployees;
|
||||
}
|
||||
|
||||
void Team::setTeamId(const std::string& id)
|
||||
{
|
||||
m_id = id;
|
||||
}
|
||||
|
||||
void Team::setTeamName(const std::string& name)
|
||||
{
|
||||
m_name = name;
|
||||
}
|
||||
|
||||
void Team::setTeamLead(std::shared_ptr<Employee> lead)
|
||||
{
|
||||
m_lead = lead;
|
||||
}
|
||||
|
||||
void Team::setEmployeesInTeam(const employeeMap& employees)
|
||||
{
|
||||
m_employees = employees;
|
||||
}
|
||||
|
||||
void Team::setMaximumNumberOfEmployeesInTeam(int maximumNumberOfEmployees)
|
||||
{
|
||||
m_maximumNumberOfEmployees = maximumNumberOfEmployees;
|
||||
}
|
||||
@@ -1,5 +1,34 @@
|
||||
#pragma once
|
||||
#include <string>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include "Employee.h"
|
||||
using employeeMap = std::map<std::string, std::shared_ptr<Employee>>;
|
||||
|
||||
class Team
|
||||
{
|
||||
};
|
||||
|
||||
private:
|
||||
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,
|
||||
const std::string& name,
|
||||
std::shared_ptr<Employee> lead,
|
||||
int maximumNumberOfEmployees)
|
||||
: m_id(id), m_name(name), m_lead(lead), m_maximumNumberOfEmployees(maximumNumberOfEmployees) {
|
||||
}
|
||||
const std::string& getTeamId() const;
|
||||
const std::string& getTeamName() const;
|
||||
std::shared_ptr<Employee> getTeamLead() const;
|
||||
const employeeMap& getEmployeesInTeam() const;
|
||||
int getMaximumNumberOfEmployeesInTeam() const;
|
||||
void setTeamId(const std::string& id);
|
||||
void setTeamName(const std::string& name);
|
||||
void setTeamLead(std::shared_ptr<Employee> lead);
|
||||
void setEmployeesInTeam(const employeeMap& employees);
|
||||
void setMaximumNumberOfEmployeesInTeam(int maximumNumberOfEmployees);
|
||||
};
|
||||
@@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
#include "Employee.h"
|
||||
|
||||
class TeamExecutive : public Employee
|
||||
{
|
||||
};
|
||||
|
||||
@@ -1 +1,51 @@
|
||||
#include "Ticket.h"
|
||||
|
||||
const std::string& Ticket::getTicketId() const
|
||||
{
|
||||
return m_id;
|
||||
}
|
||||
|
||||
const std::string& Ticket::getDescription() const
|
||||
{
|
||||
return m_description;
|
||||
}
|
||||
|
||||
const std::string& Ticket::getEmployeeId() const
|
||||
{
|
||||
return m_employeeId;
|
||||
}
|
||||
|
||||
Enums::TicketStatus Ticket::getTicketStatus() const
|
||||
{
|
||||
return m_status;
|
||||
}
|
||||
|
||||
Enums::TicketType Ticket::getTicketType() const
|
||||
{
|
||||
return m_type;
|
||||
}
|
||||
|
||||
void Ticket::setTicketId(const std::string& id)
|
||||
{
|
||||
m_id = id;
|
||||
}
|
||||
|
||||
void Ticket::setTicketDescription(const std::string& description)
|
||||
{
|
||||
m_description = description;
|
||||
}
|
||||
|
||||
void Ticket::setEmployeeId(const std::string& id)
|
||||
{
|
||||
m_employeeId = id;
|
||||
}
|
||||
|
||||
void Ticket::setTicketStatus(Enums::TicketStatus status)
|
||||
{
|
||||
m_status = status;
|
||||
}
|
||||
|
||||
void Ticket::setTicketType(Enums::TicketType type)
|
||||
{
|
||||
m_type = type;
|
||||
}
|
||||
@@ -1,5 +1,31 @@
|
||||
#pragma once
|
||||
#include <string>
|
||||
#include "Enums.h"
|
||||
|
||||
class Ticket
|
||||
{
|
||||
};
|
||||
|
||||
private:
|
||||
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,
|
||||
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) {}
|
||||
const std::string& getTicketId() const;
|
||||
Enums::TicketType getTicketType() const;
|
||||
const std::string& getDescription() const;
|
||||
Enums::TicketStatus getTicketStatus() const;
|
||||
const std::string& getEmployeeId() const;
|
||||
void setTicketId(const std::string& id);
|
||||
void setTicketType(Enums::TicketType type);
|
||||
void setTicketDescription(const std::string& description);
|
||||
void setTicketStatus(Enums::TicketStatus status);
|
||||
void setEmployeeId(const std::string& id);
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
#include "LogService.h"
|
||||
@@ -0,0 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
class LogService
|
||||
{
|
||||
};
|
||||
@@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
class TicketManagementService
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
#include "Enums.h"
|
||||
@@ -0,0 +1,72 @@
|
||||
#pragma once
|
||||
|
||||
namespace Enums {
|
||||
|
||||
enum class AccountStatus
|
||||
{
|
||||
ACTIVE,
|
||||
INACTIVE
|
||||
};
|
||||
|
||||
enum class TeamStatus
|
||||
{
|
||||
IN_TEAM,
|
||||
NOT_IN_TEAM
|
||||
};
|
||||
|
||||
enum class CandidateStatus
|
||||
{
|
||||
PENDING,
|
||||
SHORTLISTED,
|
||||
REJECTED
|
||||
};
|
||||
|
||||
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
|
||||
};
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
#include "inputHelper.h"
|
||||
|
||||
void util::readString(std::string& value)
|
||||
{
|
||||
getline(std::cin >> std::ws, value);
|
||||
}
|
||||
|
||||
void util::pressEnter()
|
||||
{
|
||||
system("pause");
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
#pragma once
|
||||
#include <iostream>
|
||||
#include <limits>
|
||||
#include <string>
|
||||
#include <stdexcept>
|
||||
|
||||
namespace util
|
||||
{
|
||||
template <typename T>
|
||||
void readValue(T& value)
|
||||
{
|
||||
std::cin >> value;
|
||||
if (std::cin.fail())
|
||||
{
|
||||
std::cin.clear();
|
||||
std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
|
||||
throw std::runtime_error("Invalid Console Input");
|
||||
}
|
||||
}
|
||||
|
||||
void readString(std::string&);
|
||||
void pressEnter();
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
#include "outputHelper.h"
|
||||
|
||||
void util::clear()
|
||||
{
|
||||
std::cout << "\x1B[2J\x1B[H" << std::flush;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
#pragma once
|
||||
#include <iostream>
|
||||
|
||||
namespace util
|
||||
{
|
||||
void clear();
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
#include <sstream>
|
||||
#include <iomanip>
|
||||
#include <stdexcept>
|
||||
#include "Timestamp.h"
|
||||
|
||||
util::Timestamp::Timestamp()
|
||||
{
|
||||
m_time = std::time(nullptr);
|
||||
}
|
||||
|
||||
util::Timestamp::Timestamp(std::time_t timeValue)
|
||||
{
|
||||
m_time = timeValue;
|
||||
}
|
||||
|
||||
util::Timestamp util::Timestamp::fromString(const std::string& timeString)
|
||||
{
|
||||
std::tm timeStruct = {};
|
||||
std::istringstream inputStream(timeString);
|
||||
inputStream >> std::get_time(&timeStruct, "%Y-%m-%d %H:%M:%S");
|
||||
if (inputStream.fail())
|
||||
{
|
||||
throw std::runtime_error("Invalid time format");
|
||||
}
|
||||
std::time_t parsedTimestamp = std::mktime(&timeStruct);
|
||||
return Timestamp(parsedTimestamp);
|
||||
}
|
||||
|
||||
std::string util::Timestamp::toString() const
|
||||
{
|
||||
std::tm timeStruct = {};
|
||||
localtime_s(&timeStruct, &m_time);
|
||||
std::ostringstream outputStream;
|
||||
outputStream << std::put_time(&timeStruct, "%Y-%m-%d %H:%M:%S");
|
||||
return outputStream.str();
|
||||
}
|
||||
|
||||
double util::Timestamp::getDurationInSeconds(const Timestamp& startTimestamp, const Timestamp& endTimestamp)
|
||||
{
|
||||
return std::difftime(endTimestamp.m_time, startTimestamp.m_time);
|
||||
}
|
||||
|
||||
int util::Timestamp::getDateAsInt() const
|
||||
{
|
||||
std::tm timeStruct{};
|
||||
localtime_s(&timeStruct, &m_time);
|
||||
int year = timeStruct.tm_year + 1900;
|
||||
int month = timeStruct.tm_mon + 1;
|
||||
int day = timeStruct.tm_mday;
|
||||
return year * 10000 + month * 100 + day;
|
||||
}
|
||||
|
||||
double util::Timestamp::getDurationInMinutes(const Timestamp& startTimestamp, const Timestamp& endTimestamp)
|
||||
{
|
||||
return getDurationInSeconds(startTimestamp, endTimestamp) / 60.0;
|
||||
}
|
||||
|
||||
double util::Timestamp::getDurationInHours(const Timestamp& startTimestamp, const Timestamp& endTimestamp)
|
||||
{
|
||||
return getDurationInSeconds(startTimestamp, endTimestamp) / 3600.0;
|
||||
}
|
||||
|
||||
bool util::Timestamp::operator<(const Timestamp& other) const
|
||||
{
|
||||
return m_time < other.m_time;
|
||||
}
|
||||
|
||||
bool util::Timestamp::operator>(const Timestamp& other) const
|
||||
{
|
||||
return m_time > other.m_time;
|
||||
}
|
||||
|
||||
bool util::Timestamp::operator<=(const Timestamp& other) const
|
||||
{
|
||||
return m_time <= other.m_time;
|
||||
}
|
||||
|
||||
bool util::Timestamp::operator>=(const Timestamp& other) const
|
||||
{
|
||||
return m_time >= other.m_time;
|
||||
}
|
||||
|
||||
bool util::Timestamp::operator==(const Timestamp& other) const
|
||||
{
|
||||
return m_time == other.m_time;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
#pragma once
|
||||
#include <ctime>
|
||||
#include <string>
|
||||
|
||||
namespace util
|
||||
{
|
||||
class Timestamp
|
||||
{
|
||||
private:
|
||||
std::time_t m_time;
|
||||
Timestamp(std::time_t time);
|
||||
public:
|
||||
Timestamp();
|
||||
static Timestamp fromString(const std::string& timeString);
|
||||
std::string toString() const;
|
||||
static double getDurationInHours(const Timestamp&, const Timestamp&);
|
||||
static double getDurationInMinutes(const Timestamp&, const Timestamp&);
|
||||
static double getDurationInSeconds(const Timestamp&, const Timestamp&);
|
||||
int getDateAsInt() const;
|
||||
bool operator>(const Timestamp&) const;
|
||||
bool operator<(const Timestamp&) const;
|
||||
bool operator>=(const Timestamp&) const;
|
||||
bool operator<=(const Timestamp&) const;
|
||||
bool operator==(const Timestamp&) const;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
#include "Validator.h"
|
||||
|
||||
bool util::isPhoneNumberValid(const std::string& phoneNumber) {
|
||||
if (phoneNumber.size() != 10)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return std::all_of(phoneNumber.begin(), phoneNumber.end(),
|
||||
[](char character)
|
||||
{
|
||||
return std::isdigit(character);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
bool util::isEmailValid(const std::string& email) {
|
||||
size_t index = email.find('@');
|
||||
if (index == std::string::npos) return false;
|
||||
if (email.find('@', index + 1) != std::string::npos)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (index == 0 || index == email.size() - 1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
#include<string>
|
||||
#include<algorithm>
|
||||
#include<cctype>
|
||||
|
||||
namespace util
|
||||
{
|
||||
bool isPhoneNumberValid(const std::string&);
|
||||
bool isEmailValid(const std::string&);
|
||||
}
|
||||
Reference in New Issue
Block a user