Compare commits
10 Commits
def0f4022b
...
1e6fc4e7bd
| Author | SHA1 | Date | |
|---|---|---|---|
| 1e6fc4e7bd | |||
| 853ed05e8d | |||
| 85f97f30f9 | |||
| 83f1c4183c | |||
| 75b69f8c11 | |||
| 7e0becaa3e | |||
| 6c05d2b352 | |||
| 2757e5ca98 | |||
| 21549b4c24 | |||
| 9a791eadcd |
@@ -1,17 +1,68 @@
|
|||||||
|
/*
|
||||||
|
* File: ZenvyController.cpp
|
||||||
|
* Description : Controls data flow between UI and Service Layers.
|
||||||
|
* Author: Trenser
|
||||||
|
* Created : 01-Apr-2026
|
||||||
|
*/
|
||||||
|
|
||||||
#include "ZenvyController.h"
|
#include "ZenvyController.h"
|
||||||
|
|
||||||
//Authentication
|
/*
|
||||||
|
* Function: login
|
||||||
|
* Description: authenticates the employee based on email and password
|
||||||
|
* Parameters:
|
||||||
|
* email - email of the employee
|
||||||
|
* password - password of the employee
|
||||||
|
* Returns:
|
||||||
|
* Tuple - login status, employee type, employee designation
|
||||||
|
* login status - success or failed
|
||||||
|
* employee type - type of the employee logged in
|
||||||
|
* employee designation - designation if employee type is GENERAL.
|
||||||
|
*/
|
||||||
|
|
||||||
AuthenticationDTO ZenvyController::login(const std::string& email, const std::string& password)
|
AuthenticationDTO ZenvyController::login(const std::string& email, const std::string& password)
|
||||||
{
|
{
|
||||||
return m_authenticationManagementService->login(email, password);
|
return m_authenticationManagementService->login(email, password);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function: changePassword
|
||||||
|
* Description: updates the password of the currently authenticated employee.
|
||||||
|
* Parameters:
|
||||||
|
* password - the new password to be set for the employee
|
||||||
|
* Returns:
|
||||||
|
* void - no return value
|
||||||
|
*/
|
||||||
|
|
||||||
void ZenvyController::logout()
|
void ZenvyController::logout()
|
||||||
{
|
{
|
||||||
m_authenticationManagementService->logout();
|
m_authenticationManagementService->logout();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function: changePassword
|
||||||
|
* Description: updates the password of the currently authenticated employee.
|
||||||
|
* Parameters:
|
||||||
|
* password - the new password to be set for the employee
|
||||||
|
* Returns:
|
||||||
|
* void - no return value
|
||||||
|
*/
|
||||||
|
|
||||||
void ZenvyController::changePassword(const std::string& password)
|
void ZenvyController::changePassword(const std::string& password)
|
||||||
{
|
{
|
||||||
m_authenticationManagementService->changePassword(password);
|
m_authenticationManagementService->changePassword(password);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ZenvyController::~ZenvyController()
|
||||||
|
{
|
||||||
|
delete m_authenticationManagementService;
|
||||||
|
delete m_attendanceManagementService;
|
||||||
|
delete m_bookingManagementService;
|
||||||
|
delete m_employeeManagememtService;
|
||||||
|
delete m_leaveManagementService;
|
||||||
|
delete m_notificationManagementService;
|
||||||
|
delete m_payslipManagementService;
|
||||||
|
delete m_talentAcquisitionManagementService;
|
||||||
|
delete m_teamManagementService;
|
||||||
|
delete m_ticketManagementService;
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
|
/*
|
||||||
|
* File: ZenvyController.h
|
||||||
|
* Description : Controls data flow between UI and Service Layers.
|
||||||
|
* Author: Trenser
|
||||||
|
* Created : 01-Apr-2026
|
||||||
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <memory>
|
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include "AuthenticationManagementService.h"
|
#include "AuthenticationManagementService.h"
|
||||||
#include "AttendanceManagementService.h"
|
#include "AttendanceManagementService.h"
|
||||||
@@ -16,31 +22,30 @@
|
|||||||
class ZenvyController
|
class ZenvyController
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
std::shared_ptr<AuthenticationManagementService> m_authenticationManagementService;
|
AuthenticationManagementService* m_authenticationManagementService;
|
||||||
std::shared_ptr<AttendanceManagementService> m_attendanceManagementService;
|
AttendanceManagementService* m_attendanceManagementService;
|
||||||
std::shared_ptr<BookingManagementService> m_bookingManagementService;
|
BookingManagementService* m_bookingManagementService;
|
||||||
std::shared_ptr<EmployeeManagememtService> m_employeeManagememtService;
|
EmployeeManagememtService* m_employeeManagememtService;
|
||||||
std::shared_ptr<LeaveManagementService> m_leaveManagementService;
|
LeaveManagementService* m_leaveManagementService;
|
||||||
std::shared_ptr<NotificationManagementService> m_notificationManagementService;
|
NotificationManagementService* m_notificationManagementService;
|
||||||
std::shared_ptr<PayslipManagementService> m_payslipManagementService;
|
PayslipManagementService* m_payslipManagementService;
|
||||||
std::shared_ptr<TalentAcquisitionManagementService> m_talentAcquisitionManagementService;
|
TalentAcquisitionManagementService* m_talentAcquisitionManagementService;
|
||||||
std::shared_ptr<TeamManagementService> m_teamManagementService;
|
TeamManagementService* m_teamManagementService;
|
||||||
std::shared_ptr<TicketManagementService> m_ticketManagementService;
|
TicketManagementService* m_ticketManagementService;
|
||||||
public:
|
public:
|
||||||
ZenvyController() :
|
ZenvyController() :
|
||||||
m_authenticationManagementService(std::make_shared<AuthenticationManagementService>()),
|
m_authenticationManagementService(new AuthenticationManagementService()),
|
||||||
m_attendanceManagementService(std::make_shared<AttendanceManagementService>()),
|
m_attendanceManagementService(new AttendanceManagementService()),
|
||||||
m_bookingManagementService(std::make_shared<BookingManagementService>()),
|
m_bookingManagementService(new BookingManagementService()),
|
||||||
m_employeeManagememtService(std::make_shared<EmployeeManagememtService>()),
|
m_employeeManagememtService(new EmployeeManagememtService()),
|
||||||
m_leaveManagementService(std::make_shared<LeaveManagementService>()),
|
m_leaveManagementService(new LeaveManagementService()),
|
||||||
m_notificationManagementService(std::make_shared<NotificationManagementService>()),
|
m_notificationManagementService(new NotificationManagementService()),
|
||||||
m_payslipManagementService(std::make_shared<PayslipManagementService>()),
|
m_payslipManagementService(new PayslipManagementService()),
|
||||||
m_talentAcquisitionManagementService(std::make_shared<TalentAcquisitionManagementService>()),
|
m_talentAcquisitionManagementService(new TalentAcquisitionManagementService()),
|
||||||
m_teamManagementService(std::make_shared<TeamManagementService>()),
|
m_teamManagementService(new TeamManagementService()),
|
||||||
m_ticketManagementService(std::make_shared<TicketManagementService>()) {};
|
m_ticketManagementService(new TicketManagementService()) {};
|
||||||
|
AuthenticationDTO login(const std::string& email, const std::string& password);
|
||||||
//Authentication
|
void logout();
|
||||||
AuthenticationDTO login(const std::string& email, const std::string& password);
|
void changePassword(const std::string&);
|
||||||
void logout();
|
~ZenvyController();
|
||||||
void changePassword(const std::string&);
|
};
|
||||||
};
|
|
||||||
@@ -1,33 +1,112 @@
|
|||||||
|
/*
|
||||||
|
* File: DataStore.cpp
|
||||||
|
* Description: Central Storage for all the System Data.
|
||||||
|
* Author: Trenser
|
||||||
|
* Created: 01-Apr-2026
|
||||||
|
*/
|
||||||
|
|
||||||
#include "DataStore.h"
|
#include "DataStore.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function: getInstance
|
||||||
|
* Description: provides a singleton instance of the DataStore.
|
||||||
|
* Parameters:
|
||||||
|
* None
|
||||||
|
* Returns:
|
||||||
|
* DataStore& - reference to the single DataStore object.
|
||||||
|
*/
|
||||||
|
|
||||||
DataStore& DataStore::getInstance()
|
DataStore& DataStore::getInstance()
|
||||||
{
|
{
|
||||||
static DataStore dataStore;
|
static DataStore dataStore;
|
||||||
return dataStore;
|
return dataStore;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function: getLogs
|
||||||
|
* Description: retrieves the log map containing system logs.
|
||||||
|
* Parameters:
|
||||||
|
* None
|
||||||
|
* Returns:
|
||||||
|
* logMap& - reference to the log map.
|
||||||
|
*/
|
||||||
|
|
||||||
logMap& DataStore::getLogs()
|
logMap& DataStore::getLogs()
|
||||||
{
|
{
|
||||||
return m_logs;
|
return m_logs;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<Employee>& DataStore::getAuthenticatedEmployee()
|
/*
|
||||||
|
* Function: getAuthenticatedEmployee
|
||||||
|
* Description: returns the currently authenticated employee.
|
||||||
|
* Parameters:
|
||||||
|
* None
|
||||||
|
* Returns:
|
||||||
|
* std::shared_ptr<Employee>& - reference to the authenticated employee object.
|
||||||
|
*/
|
||||||
|
|
||||||
|
Employee*& DataStore::getAuthenticatedEmployee()
|
||||||
{
|
{
|
||||||
return m_authenticatedEmployee;
|
return m_authenticatedEmployee;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DataStore::setAuthenticatedEmployee(std::shared_ptr<Employee> authenticatedEmployee)
|
/*
|
||||||
|
* Function: setAuthenticatedEmployee
|
||||||
|
* Description: sets the currently authenticated employee.
|
||||||
|
* Parameters:
|
||||||
|
* authenticatedEmployee - shared pointer to the employee object to be set as authenticated.
|
||||||
|
* Returns:
|
||||||
|
* void - no return value.
|
||||||
|
*/
|
||||||
|
|
||||||
|
void DataStore::setAuthenticatedEmployee(Employee* authenticatedEmployee)
|
||||||
{
|
{
|
||||||
m_authenticatedEmployee = authenticatedEmployee;
|
m_authenticatedEmployee = authenticatedEmployee;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function: getEmployees
|
||||||
|
* Description: retrieves the employee map containing all employees.
|
||||||
|
* Parameters:
|
||||||
|
* None
|
||||||
|
* Returns:
|
||||||
|
* employeeMap& - reference to the employee map.
|
||||||
|
*/
|
||||||
|
|
||||||
employeeMap& DataStore::getEmployees()
|
employeeMap& DataStore::getEmployees()
|
||||||
{
|
{
|
||||||
return m_employees;
|
return m_employees;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<Employee>& DataStore::getAuthenticatedUser()
|
/*
|
||||||
|
* Function: getAuthenticatedUser
|
||||||
|
* Description: alias for getAuthenticatedEmployee, returns the currently authenticated employee.
|
||||||
|
* Parameters:
|
||||||
|
* None
|
||||||
|
* Returns:
|
||||||
|
* std::shared_ptr<Employee>& - reference to the authenticated employee object.
|
||||||
|
*/
|
||||||
|
|
||||||
|
Employee* DataStore::getAuthenticatedUser()
|
||||||
{
|
{
|
||||||
return m_authenticatedEmployee;
|
return m_authenticatedEmployee;
|
||||||
}
|
}
|
||||||
|
DataStore::~DataStore()
|
||||||
|
{
|
||||||
|
for (auto& pair : m_employees)
|
||||||
|
{
|
||||||
|
delete pair.second;
|
||||||
|
}
|
||||||
|
m_employees.clear();
|
||||||
|
for (auto& pair : m_logs)
|
||||||
|
{
|
||||||
|
delete pair.second;
|
||||||
|
}
|
||||||
|
m_logs.clear();
|
||||||
|
if (m_authenticatedEmployee)
|
||||||
|
{
|
||||||
|
delete m_authenticatedEmployee;
|
||||||
|
m_authenticatedEmployee = nullptr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
|
/*
|
||||||
|
* File: DataStore.h
|
||||||
|
* Description: Central Storage for all the System Data.
|
||||||
|
* Author: Trenser
|
||||||
|
* Created: 01-Apr-2026
|
||||||
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <memory>
|
|
||||||
#include <map>
|
#include <map>
|
||||||
#include "Employee.h"
|
#include "Employee.h"
|
||||||
#include "Log.h"
|
#include "Log.h"
|
||||||
@@ -19,16 +25,16 @@
|
|||||||
#include "Announcement.h"
|
#include "Announcement.h"
|
||||||
#include "Faq.h"
|
#include "Faq.h"
|
||||||
|
|
||||||
using employeeMap = std::map<std::string, std::shared_ptr<Employee>>;
|
using employeeMap = std::map<std::string,Employee*>;
|
||||||
using logMap = std::map<util::Timestamp, std::shared_ptr<Log>>;
|
using logMap = std::map<util::Timestamp, Log*>;
|
||||||
|
|
||||||
class DataStore
|
class DataStore
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
std::shared_ptr<Employee> m_authenticatedEmployee;
|
Employee* m_authenticatedEmployee;
|
||||||
employeeMap m_employees;
|
employeeMap m_employees;
|
||||||
logMap m_logs;
|
logMap m_logs;
|
||||||
DataStore() = default;
|
DataStore() : m_authenticatedEmployee(nullptr) {};
|
||||||
public:
|
public:
|
||||||
static DataStore& getInstance();
|
static DataStore& getInstance();
|
||||||
DataStore(const DataStore&) = delete;
|
DataStore(const DataStore&) = delete;
|
||||||
@@ -36,8 +42,9 @@ public:
|
|||||||
DataStore(DataStore&&) = delete;
|
DataStore(DataStore&&) = delete;
|
||||||
DataStore& operator=(DataStore&&) = delete;
|
DataStore& operator=(DataStore&&) = delete;
|
||||||
employeeMap& getEmployees();
|
employeeMap& getEmployees();
|
||||||
std::shared_ptr<Employee>& getAuthenticatedUser();
|
Employee* getAuthenticatedUser();
|
||||||
logMap& getLogs();
|
logMap& getLogs();
|
||||||
std::shared_ptr<Employee>& getAuthenticatedEmployee();
|
Employee*& getAuthenticatedEmployee();
|
||||||
void setAuthenticatedEmployee(std::shared_ptr < Employee>);
|
void setAuthenticatedEmployee(Employee*);
|
||||||
|
~DataStore();
|
||||||
};
|
};
|
||||||
@@ -1,13 +1,30 @@
|
|||||||
|
/*
|
||||||
|
* File: Factory.h
|
||||||
|
* Description: Provides a generic factory utility to create shared_ptr instances of objects.
|
||||||
|
* Author: Ajmal J S
|
||||||
|
* Created: 01-Apr-2026
|
||||||
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <memory>
|
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
class Factory
|
class Factory
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function: getObject
|
||||||
|
* Description: Creates and returns a shared_ptr to an object of type T.
|
||||||
|
* Parameters:
|
||||||
|
* T - the type of object to be created
|
||||||
|
* Args - constructor arguments forwarded to T's constructor
|
||||||
|
* Returns:
|
||||||
|
* std::shared_ptr<T> - a shared pointer managing the newly created object
|
||||||
|
*/
|
||||||
|
|
||||||
template<typename T, typename... Args>
|
template<typename T, typename... Args>
|
||||||
static std::shared_ptr<T> getObject(Args&&... args)
|
static T* getObject(Args&&... args)
|
||||||
{
|
{
|
||||||
return std::make_shared<T>(std::forward<Args>(args)...);
|
return T*(std::forward<Args>(args)...);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1 +1,7 @@
|
|||||||
|
/*
|
||||||
|
* File: Admin.cpp
|
||||||
|
* Description: Admin model class
|
||||||
|
* Author: Trenser
|
||||||
|
* Created: 31-Mar-2026
|
||||||
|
*/
|
||||||
#include "Admin.h"
|
#include "Admin.h"
|
||||||
|
|||||||
@@ -1,3 +1,10 @@
|
|||||||
|
/*
|
||||||
|
* File: Admin.h
|
||||||
|
* Description: Admin model class
|
||||||
|
* Author: Trenser
|
||||||
|
* Created: 31-Mar-2026
|
||||||
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "Employee.h"
|
#include "Employee.h"
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,12 @@
|
|||||||
|
/*
|
||||||
|
* File: Announcement.cpp
|
||||||
|
* Description: The Announcement class defines a simple object for managing announcement details.
|
||||||
|
* Author: Trenser
|
||||||
|
* Created: 31-Mar-2026
|
||||||
|
*/
|
||||||
#include "Announcement.h"
|
#include "Announcement.h"
|
||||||
|
|
||||||
|
//Getters and Setters
|
||||||
const std::string& Announcement::getAnnouncementId() const
|
const std::string& Announcement::getAnnouncementId() const
|
||||||
{
|
{
|
||||||
return m_id;
|
return m_id;
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
/*
|
||||||
|
* File: Announcement.h
|
||||||
|
* Description: The Announcement class defines a simple object for managing announcement details.
|
||||||
|
* Author: Trenser
|
||||||
|
* Created: 31-Mar-2026
|
||||||
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <string>
|
#include <string>
|
||||||
#include "Timestamp.h"
|
#include "Timestamp.h"
|
||||||
|
|||||||
@@ -1,5 +1,12 @@
|
|||||||
|
/*
|
||||||
|
* File: Attendance.cpp
|
||||||
|
* Description: The Attendance class represents an attendance record by storing an ID, login and logout timestamps.
|
||||||
|
* Author: Trenser
|
||||||
|
* Created: 31-Mar-2026
|
||||||
|
*/
|
||||||
#include "Attendance.h"
|
#include "Attendance.h"
|
||||||
|
|
||||||
|
//Getters and Setters
|
||||||
const std::string& Attendance::getAttendanceId() const
|
const std::string& Attendance::getAttendanceId() const
|
||||||
{
|
{
|
||||||
return m_id;
|
return m_id;
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
/*
|
||||||
|
* File: Attendance.h
|
||||||
|
* Description: The Attendance class represents an attendance record by storing an ID, login and logout timestamps.
|
||||||
|
* Author: Trenser
|
||||||
|
* Created: 31-Mar-2026
|
||||||
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <string>
|
#include <string>
|
||||||
#include "Timestamp.h"
|
#include "Timestamp.h"
|
||||||
|
|||||||
@@ -1,5 +1,12 @@
|
|||||||
|
/*
|
||||||
|
* File: Booking.cpp
|
||||||
|
* Description: The Booking class represents a time‑based booking with employee and team details and supports duration calculation.
|
||||||
|
* Author: Trenser
|
||||||
|
* Created: 31-Mar-2026
|
||||||
|
*/
|
||||||
#include "Booking.h"
|
#include "Booking.h"
|
||||||
|
|
||||||
|
//Getters and Setters
|
||||||
const std::string& Booking::getBookingId() const
|
const std::string& Booking::getBookingId() const
|
||||||
{
|
{
|
||||||
return m_id;
|
return m_id;
|
||||||
@@ -20,7 +27,7 @@ const std::string& Booking::getEmployeeId() const
|
|||||||
return m_employeeId;
|
return m_employeeId;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<Team> Booking::getTeam() const
|
Team* Booking::getTeam() const
|
||||||
{
|
{
|
||||||
return m_team;
|
return m_team;
|
||||||
}
|
}
|
||||||
@@ -45,7 +52,7 @@ void Booking::setEmployeeId(const std::string& employeeId)
|
|||||||
m_employeeId = employeeId;
|
m_employeeId = employeeId;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Booking::setTeam(std::shared_ptr<Team> team)
|
void Booking::setTeam(Team* team)
|
||||||
{
|
{
|
||||||
m_team = team;
|
m_team = team;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,11 @@
|
|||||||
|
/*
|
||||||
|
* File: Booking.h
|
||||||
|
* Description: The Booking class represents a time?based booking with employee and team details and supports duration calculation.
|
||||||
|
* Author: Trenser
|
||||||
|
* Created: 31-Mar-2026
|
||||||
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <memory>
|
|
||||||
#include "Team.h"
|
#include "Team.h"
|
||||||
#include "Timestamp.h"
|
#include "Timestamp.h"
|
||||||
|
|
||||||
@@ -11,25 +16,24 @@ private:
|
|||||||
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;
|
Team* m_team;
|
||||||
public:
|
public:
|
||||||
Booking() : m_id(""), m_startTime(), m_endTime(), m_employeeId(""), m_team(nullptr) {}
|
Booking() : m_id(""), m_startTime(), m_endTime(), m_employeeId(""), m_team(nullptr) {};
|
||||||
Booking(const std::string& id,
|
Booking(const std::string& id,
|
||||||
const util::Timestamp& startTime,
|
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)
|
Team* team) : m_id(id), m_startTime(startTime), m_endTime(endTime), m_employeeId(employeeId), m_team(team) {};
|
||||||
: m_id(id), 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;
|
||||||
const std::string& getEmployeeId() const;
|
const std::string& getEmployeeId() const;
|
||||||
std::shared_ptr<Team> getTeam() const;
|
Team* getTeam() const;
|
||||||
void setBookingId(const std::string& id);
|
void setBookingId(const std::string& id);
|
||||||
void setStartTime(const util::Timestamp& startTime);
|
void setStartTime(const util::Timestamp& startTime);
|
||||||
void setEndTime(const util::Timestamp& endTime);
|
void setEndTime(const util::Timestamp& endTime);
|
||||||
void setEmployeeId(const std::string& employeeId);
|
void setEmployeeId(const std::string& employeeId);
|
||||||
void setTeam(std::shared_ptr<Team> team);
|
void setTeam(Team* team);
|
||||||
double getDurationInHours() const;
|
double getDurationInHours() const;
|
||||||
double getDurationInMinutes() const;
|
double getDurationInMinutes() const;
|
||||||
};
|
};
|
||||||
@@ -1,5 +1,12 @@
|
|||||||
|
/*
|
||||||
|
* File: Candidate.cpp
|
||||||
|
* Description: The Candidate class stores and manages a candidate’s information.
|
||||||
|
* Author: Trenser
|
||||||
|
* Created: 31-Mar-2026
|
||||||
|
*/
|
||||||
#include "Candidate.h"
|
#include "Candidate.h"
|
||||||
|
|
||||||
|
//Getters and Setters
|
||||||
const std::string& Candidate::getCandidateId() const
|
const std::string& Candidate::getCandidateId() const
|
||||||
{
|
{
|
||||||
return m_id;
|
return m_id;
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
/*
|
||||||
|
* File: Candidate.h
|
||||||
|
* Description: The Candidate class stores and manages a candidate’s information.
|
||||||
|
* Author: Trenser
|
||||||
|
* Created: 31-Mar-2026
|
||||||
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <string>
|
#include <string>
|
||||||
#include "Enums.h"
|
#include "Enums.h"
|
||||||
|
|||||||
@@ -1,5 +1,12 @@
|
|||||||
|
/*
|
||||||
|
* File: Employee.cpp
|
||||||
|
* Description: The Employee class manages employee information and associated work records such as payroll, attendance, leaves, and payslips.
|
||||||
|
* Author: Trenser
|
||||||
|
* Created: 31-Mar-2026
|
||||||
|
*/
|
||||||
#include "Employee.h"
|
#include "Employee.h"
|
||||||
|
|
||||||
|
//Getters and Setters
|
||||||
const std::string& Employee::getEmployeeId() const
|
const std::string& Employee::getEmployeeId() const
|
||||||
{
|
{
|
||||||
return m_id;
|
return m_id;
|
||||||
@@ -40,7 +47,7 @@ const std::string& Employee::getEmployeeTeamId() const
|
|||||||
return m_teamId;
|
return m_teamId;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<Payroll> Employee::getPayroll() const
|
Payroll* Employee::getPayroll() const
|
||||||
{
|
{
|
||||||
return m_payroll;
|
return m_payroll;
|
||||||
}
|
}
|
||||||
@@ -95,12 +102,12 @@ void Employee::setEmployeeTeamId(const std::string& teamId)
|
|||||||
m_teamId = teamId;
|
m_teamId = teamId;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Employee::setEmployeePayroll(std::shared_ptr<Payroll> payroll)
|
void Employee::setEmployeePayroll(Payroll* payroll)
|
||||||
{
|
{
|
||||||
m_payroll = payroll;
|
m_payroll = payroll;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Employee::addPayslip(std::shared_ptr<Payslip> payslip)
|
void Employee::addPayslip(Payslip* payslip)
|
||||||
{
|
{
|
||||||
if (payslip)
|
if (payslip)
|
||||||
{
|
{
|
||||||
@@ -108,7 +115,7 @@ void Employee::addPayslip(std::shared_ptr<Payslip> payslip)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Employee::addAttendance(std::shared_ptr<Attendance> attendance)
|
void Employee::addAttendance(Attendance* attendance)
|
||||||
{
|
{
|
||||||
if (attendance)
|
if (attendance)
|
||||||
{
|
{
|
||||||
@@ -116,7 +123,7 @@ void Employee::addAttendance(std::shared_ptr<Attendance> attendance)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Employee::addLeave(std::shared_ptr<Leave> leave)
|
void Employee::addLeave(Leave* leave)
|
||||||
{
|
{
|
||||||
if (leave)
|
if (leave)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,15 +1,20 @@
|
|||||||
|
/*
|
||||||
|
* File: Employee.h
|
||||||
|
* Description: The Employee class manages employee information and associated work records such as payroll, attendance, leaves, and payslips.
|
||||||
|
* Author: Trenser
|
||||||
|
* Created: 31-Mar-2026
|
||||||
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <memory>
|
|
||||||
#include <map>
|
#include <map>
|
||||||
#include "Payslip.h"
|
#include "Payslip.h"
|
||||||
#include "Attendance.h"
|
#include "Attendance.h"
|
||||||
#include "Leave.h"
|
#include "Leave.h"
|
||||||
#include "Payroll.h"
|
#include "Payroll.h"
|
||||||
#include "Enums.h"
|
#include "Enums.h"
|
||||||
using payslipMap = std::map<std::string, std::shared_ptr<Payslip>>;
|
using payslipMap = std::map<std::string, Payslip*>;
|
||||||
using attendanceMap = std::map<int, std::map<std::string, std::shared_ptr<Attendance>>>;
|
using attendanceMap = std::map<int, std::map<std::string, Attendance*>>;
|
||||||
using leaveMap = std::map<std::string, std::shared_ptr<Leave>>;
|
using leaveMap = std::map<std::string, Leave*>;
|
||||||
|
|
||||||
class Employee
|
class Employee
|
||||||
{
|
{
|
||||||
@@ -22,7 +27,7 @@ private:
|
|||||||
Enums::AccountStatus m_accountStatus;
|
Enums::AccountStatus m_accountStatus;
|
||||||
Enums::TeamStatus m_teamStatus;
|
Enums::TeamStatus m_teamStatus;
|
||||||
std::string m_teamId;
|
std::string m_teamId;
|
||||||
std::shared_ptr<Payroll> m_payroll;
|
Payroll* m_payroll;
|
||||||
payslipMap m_payslips;
|
payslipMap m_payslips;
|
||||||
attendanceMap m_attendances;
|
attendanceMap m_attendances;
|
||||||
leaveMap m_leaves;
|
leaveMap m_leaves;
|
||||||
@@ -36,7 +41,7 @@ public:
|
|||||||
const std::string& email,
|
const std::string& email,
|
||||||
const std::string& teamId,
|
const std::string& teamId,
|
||||||
Enums::EmployeeType employeeType,
|
Enums::EmployeeType employeeType,
|
||||||
std::shared_ptr<Payroll> payroll)
|
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(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) { }
|
||||||
const std::string& getEmployeeId() const;
|
const std::string& getEmployeeId() const;
|
||||||
const std::string& getEmployeePassword() const;
|
const std::string& getEmployeePassword() const;
|
||||||
@@ -46,7 +51,7 @@ public:
|
|||||||
Enums::AccountStatus getEmployeeAccountStatus() const;
|
Enums::AccountStatus getEmployeeAccountStatus() const;
|
||||||
Enums::TeamStatus getEmployeeTeamStatus() const;
|
Enums::TeamStatus getEmployeeTeamStatus() const;
|
||||||
const std::string& getEmployeeTeamId() const;
|
const std::string& getEmployeeTeamId() const;
|
||||||
std::shared_ptr<Payroll> getPayroll() const;
|
Payroll* getPayroll() const;
|
||||||
const payslipMap& getEmployeePayslips() const;
|
const payslipMap& getEmployeePayslips() const;
|
||||||
const attendanceMap& getEmployeeAttendances() const;
|
const attendanceMap& getEmployeeAttendances() const;
|
||||||
const leaveMap& getEmployeeLeaves() const;
|
const leaveMap& getEmployeeLeaves() const;
|
||||||
@@ -57,10 +62,10 @@ public:
|
|||||||
void setEmployeeAccountStatus(Enums::AccountStatus status);
|
void setEmployeeAccountStatus(Enums::AccountStatus status);
|
||||||
void setEmployeeTeamStatus(Enums::TeamStatus status);
|
void setEmployeeTeamStatus(Enums::TeamStatus status);
|
||||||
void setEmployeeTeamId(const std::string& teamId);
|
void setEmployeeTeamId(const std::string& teamId);
|
||||||
void setEmployeePayroll(std::shared_ptr<Payroll> payroll);
|
void setEmployeePayroll(Payroll* payroll);
|
||||||
void addPayslip(std::shared_ptr<Payslip> payslip);
|
void addPayslip(Payslip* payslip);
|
||||||
void addAttendance(std::shared_ptr<Attendance> attendance);
|
void addAttendance(Attendance* attendance);
|
||||||
void addLeave(std::shared_ptr<Leave> leave);
|
void addLeave(Leave* leave);
|
||||||
Enums::EmployeeType getEmployeeType() const;
|
Enums::EmployeeType getEmployeeType() const;
|
||||||
virtual ~Employee() = default;
|
virtual ~Employee() = default;
|
||||||
};
|
};
|
||||||
@@ -1 +1,7 @@
|
|||||||
|
/*
|
||||||
|
* File: Faq.h
|
||||||
|
* Description: Faq model class.
|
||||||
|
* Author: Trenser
|
||||||
|
* Created: 02-Apr-2026
|
||||||
|
*/
|
||||||
#include "Faq.h"
|
#include "Faq.h"
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
/*
|
||||||
|
* File: Faq.h
|
||||||
|
* Description: Faq model class.
|
||||||
|
* Author: Trenser
|
||||||
|
* Created: 02-Apr-2026
|
||||||
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
class Faq
|
class Faq
|
||||||
|
|||||||
@@ -1 +1,7 @@
|
|||||||
|
/*
|
||||||
|
* File: FinanceExecutive.h
|
||||||
|
* Description: FinanceExecutive model class.
|
||||||
|
* Author: Trenser
|
||||||
|
* Created: 31-Mar-2026
|
||||||
|
*/
|
||||||
#include "FinanceExecutive.h"
|
#include "FinanceExecutive.h"
|
||||||
@@ -1,3 +1,9 @@
|
|||||||
|
/*
|
||||||
|
* File: FinanceExecutive.h
|
||||||
|
* Description: FinanceExecutive model class.
|
||||||
|
* Author: Trenser
|
||||||
|
* Created: 31-Mar-2026
|
||||||
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "Employee.h"
|
#include "Employee.h"
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,12 @@
|
|||||||
|
/*
|
||||||
|
* File: GeneralEmployee.h
|
||||||
|
* Description: The GeneralEmployee class represents a general employee with a specific designation.
|
||||||
|
* Author: Trenser
|
||||||
|
* Created: 31-Mar-2026
|
||||||
|
*/
|
||||||
#include "GeneralEmployee.h"
|
#include "GeneralEmployee.h"
|
||||||
|
|
||||||
|
//Getters and Setters
|
||||||
Enums::EmployeeDesignation GeneralEmployee::getDesignation() const
|
Enums::EmployeeDesignation GeneralEmployee::getDesignation() const
|
||||||
{
|
{
|
||||||
return m_designation;
|
return m_designation;
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
/*
|
||||||
|
* File: GeneralEmployee.h
|
||||||
|
* Description: The GeneralEmployee class represents a general employee with a specific designation.
|
||||||
|
* Author: Trenser
|
||||||
|
* Created: 31-Mar-2026
|
||||||
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "Employee.h"
|
#include "Employee.h"
|
||||||
#include "Enums.h"
|
#include "Enums.h"
|
||||||
@@ -14,7 +20,7 @@ public:
|
|||||||
const std::string& phone,
|
const std::string& phone,
|
||||||
const std::string& email,
|
const std::string& email,
|
||||||
const std::string& teamId,
|
const std::string& teamId,
|
||||||
std::shared_ptr<Payroll> payroll,
|
Payroll* payroll,
|
||||||
Enums::EmployeeDesignation designation) : Employee(id, password, name, phone, email, teamId,Enums::EmployeeType::GENERAL, payroll), m_designation(designation) {}
|
Enums::EmployeeDesignation designation) : Employee(id, password, name, phone, email, teamId,Enums::EmployeeType::GENERAL, payroll), m_designation(designation) {}
|
||||||
Enums::EmployeeDesignation getDesignation() const;
|
Enums::EmployeeDesignation getDesignation() const;
|
||||||
void setDesignation(Enums::EmployeeDesignation designation);
|
void setDesignation(Enums::EmployeeDesignation designation);
|
||||||
|
|||||||
@@ -1 +1,7 @@
|
|||||||
|
/*
|
||||||
|
* File: HRManager.cpp
|
||||||
|
* Description: HRManager model class.
|
||||||
|
* Author: Trenser
|
||||||
|
* Created: 31-Mar-2026
|
||||||
|
*/
|
||||||
#include "HRManager.h"
|
#include "HRManager.h"
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
/*
|
||||||
|
* File: HRManager.h
|
||||||
|
* Description: HRManager model class.
|
||||||
|
* Author: Trenser
|
||||||
|
* Created: 31-Mar-2026
|
||||||
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "Employee.h"
|
#include "Employee.h"
|
||||||
|
|
||||||
|
|||||||
@@ -1 +1,7 @@
|
|||||||
|
/*
|
||||||
|
* File: ITExecutive.cpp
|
||||||
|
* Description: ITExecutive model class.
|
||||||
|
* Author: Trenser
|
||||||
|
* Created: 31-Mar-2026
|
||||||
|
*/
|
||||||
#include "ITExecutive.h"
|
#include "ITExecutive.h"
|
||||||
@@ -1,3 +1,9 @@
|
|||||||
|
/*
|
||||||
|
* File: ITExecutive.h
|
||||||
|
* Description: ITExecutive model class.
|
||||||
|
* Author: Trenser
|
||||||
|
* Created: 31-Mar-2026
|
||||||
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "Employee.h"
|
#include "Employee.h"
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,13 @@
|
|||||||
|
/*
|
||||||
|
File: JobListing.cpp
|
||||||
|
* Description : Represents a job opening along with its details and applied candidates.
|
||||||
|
* Author : Trenser
|
||||||
|
* Created : 01-Apr-2026
|
||||||
|
*/
|
||||||
|
|
||||||
#include "JobListing.h"
|
#include "JobListing.h"
|
||||||
|
|
||||||
|
//Getters and setters
|
||||||
const std::string& JobListing::getJobId() const
|
const std::string& JobListing::getJobId() const
|
||||||
{
|
{
|
||||||
return m_id;
|
return m_id;
|
||||||
|
|||||||
@@ -1,10 +1,17 @@
|
|||||||
|
/*
|
||||||
|
File: JobListing.h
|
||||||
|
* Description : Represents a job opening along with its details and applied candidates.
|
||||||
|
* Author : Trenser
|
||||||
|
* Created : 01-Apr-2026
|
||||||
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include "Candidate.h"
|
#include "Candidate.h"
|
||||||
#include "Enums.h"
|
#include "Enums.h"
|
||||||
using candidateMap = std::map<std::string, std::shared_ptr<Candidate>>;
|
using candidateMap = std::map<std::string, Candidate*>;
|
||||||
|
|
||||||
class JobListing
|
class JobListing
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,13 @@
|
|||||||
|
/*
|
||||||
|
File: Leave.cpp
|
||||||
|
* Description : Stores information related to an employee’s leave application.
|
||||||
|
* Author : Trenser
|
||||||
|
* Created : 31-Mar-2026
|
||||||
|
*/
|
||||||
|
|
||||||
#include "Leave.h"
|
#include "Leave.h"
|
||||||
|
|
||||||
|
//Getters and setters
|
||||||
const std::string& Leave::getLeaveId() const
|
const std::string& Leave::getLeaveId() const
|
||||||
{
|
{
|
||||||
return m_id;
|
return m_id;
|
||||||
|
|||||||
@@ -1,3 +1,10 @@
|
|||||||
|
/*
|
||||||
|
File: Leave.h
|
||||||
|
* Description : Stores information related to an employee’s leave application.
|
||||||
|
* Author : Trenser
|
||||||
|
* Created : 31-Mar-2026
|
||||||
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <string>
|
#include <string>
|
||||||
#include "Enums.h"
|
#include "Enums.h"
|
||||||
|
|||||||
@@ -1,5 +1,13 @@
|
|||||||
|
/*
|
||||||
|
File: Log.cpp
|
||||||
|
* Description : Represents a log entry containing a timestamp and an associated message.
|
||||||
|
* Author : Trenser
|
||||||
|
* Created : 01-Apr-2026
|
||||||
|
*/
|
||||||
|
|
||||||
#include "Log.h"
|
#include "Log.h"
|
||||||
|
|
||||||
|
//Getters and setters
|
||||||
const util::Timestamp& Log::getTimestamp() const
|
const util::Timestamp& Log::getTimestamp() const
|
||||||
{
|
{
|
||||||
return m_timestamp;
|
return m_timestamp;
|
||||||
|
|||||||
@@ -1,3 +1,10 @@
|
|||||||
|
/*
|
||||||
|
File: Log.h
|
||||||
|
* Description : Represents a log entry containing a timestamp and an associated message.
|
||||||
|
* Author : Trenser
|
||||||
|
* Created : 01-Apr-2026
|
||||||
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <string>
|
#include <string>
|
||||||
#include "Timestamp.h"
|
#include "Timestamp.h"
|
||||||
|
|||||||
@@ -1,5 +1,13 @@
|
|||||||
|
/*
|
||||||
|
File: Notification.cpp
|
||||||
|
* Description : Represents an employee notification with message and status details.
|
||||||
|
* Author : Trenser
|
||||||
|
* Created : 31-Mar-2026
|
||||||
|
*/
|
||||||
|
|
||||||
#include "Notification.h"
|
#include "Notification.h"
|
||||||
|
|
||||||
|
//Getters and setters
|
||||||
const std::string& Notification::getNotificationId() const
|
const std::string& Notification::getNotificationId() const
|
||||||
{
|
{
|
||||||
return m_id;
|
return m_id;
|
||||||
|
|||||||
@@ -1,3 +1,10 @@
|
|||||||
|
/*
|
||||||
|
File: Notification.h
|
||||||
|
* Description : Represents an employee notification with message and status details.
|
||||||
|
* Author : Trenser
|
||||||
|
* Created : 31-Mar-2026
|
||||||
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <string>
|
#include <string>
|
||||||
#include "Enums.h"
|
#include "Enums.h"
|
||||||
|
|||||||
@@ -1,5 +1,13 @@
|
|||||||
|
/*
|
||||||
|
File: Payroll.cpp
|
||||||
|
* Description : Stores payroll and salary breakdown details for an employee.
|
||||||
|
* Author : Trenser
|
||||||
|
* Created : 31-Mar-2026
|
||||||
|
*/
|
||||||
|
|
||||||
#include "Payroll.h"
|
#include "Payroll.h"
|
||||||
|
|
||||||
|
//Getters and setters
|
||||||
const std::string& Payroll::getPayrollId() const
|
const std::string& Payroll::getPayrollId() const
|
||||||
{
|
{
|
||||||
return m_id;
|
return m_id;
|
||||||
|
|||||||
@@ -1,3 +1,10 @@
|
|||||||
|
/*
|
||||||
|
File: Payroll.h
|
||||||
|
* Description : Stores payroll and salary breakdown details for an employee.
|
||||||
|
* Author : Trenser
|
||||||
|
* Created : 31-Mar-2026
|
||||||
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,13 @@
|
|||||||
|
/*
|
||||||
|
File: Payslip.cpp
|
||||||
|
* Description : Models a payslip entity that stores salary information.
|
||||||
|
* Author : Trenser
|
||||||
|
* Created : 31-Mar-2026
|
||||||
|
*/
|
||||||
|
|
||||||
#include "Payslip.h"
|
#include "Payslip.h"
|
||||||
|
|
||||||
|
//Getters and setters
|
||||||
const std::string& Payslip::getPayslipId() const
|
const std::string& Payslip::getPayslipId() const
|
||||||
{
|
{
|
||||||
return m_id;
|
return m_id;
|
||||||
|
|||||||
@@ -1,3 +1,10 @@
|
|||||||
|
/*
|
||||||
|
File: Payslip.h
|
||||||
|
* Description : Models a payslip entity that stores salary information.
|
||||||
|
* Author : Trenser
|
||||||
|
* Created : 31-Mar-2026
|
||||||
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,13 @@
|
|||||||
|
/*
|
||||||
|
File: Room.cpp
|
||||||
|
* Description : Models a room entity that maintains room details and manages its bookings.
|
||||||
|
* Author : Trenser
|
||||||
|
* Created : 31-Mar-2026
|
||||||
|
*/
|
||||||
|
|
||||||
#include "Room.h"
|
#include "Room.h"
|
||||||
|
|
||||||
|
//Getters and setters
|
||||||
const std::string& Room::getRoomId() const
|
const std::string& Room::getRoomId() const
|
||||||
{
|
{
|
||||||
return m_id;
|
return m_id;
|
||||||
@@ -25,7 +33,7 @@ void Room::setRoomName(const std::string& name)
|
|||||||
m_name = name;
|
m_name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Room::addBooking(std::shared_ptr<Booking> booking)
|
void Room::addBooking(Booking* booking)
|
||||||
{
|
{
|
||||||
if (booking)
|
if (booking)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,9 +1,16 @@
|
|||||||
|
/*
|
||||||
|
File: Room.h
|
||||||
|
* Description : Models a room entity that maintains room details and manages its bookings.
|
||||||
|
* Author : Trenser
|
||||||
|
* Created : 31-Mar-2026
|
||||||
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include "Booking.h"
|
#include "Booking.h"
|
||||||
using bookingMap = std::map<std::string, std::shared_ptr<Booking>>;
|
using bookingMap = std::map<std::string, Booking*>;
|
||||||
|
|
||||||
class Room
|
class Room
|
||||||
{
|
{
|
||||||
@@ -19,5 +26,5 @@ public:
|
|||||||
const bookingMap& getBookings() const;
|
const bookingMap& getBookings() const;
|
||||||
void setRoomId(const std::string& id);
|
void setRoomId(const std::string& id);
|
||||||
void setRoomName(const std::string& name);
|
void setRoomName(const std::string& name);
|
||||||
void addBooking(std::shared_ptr<Booking> booking);
|
void addBooking(Booking* booking);
|
||||||
};
|
};
|
||||||
@@ -1 +1,8 @@
|
|||||||
|
/*
|
||||||
|
File: TalentExecutive.cpp
|
||||||
|
* Description : Represents information related to a talent executive in the system.
|
||||||
|
* Author : Trenser
|
||||||
|
* Created : 31-Mar-2026
|
||||||
|
*/
|
||||||
|
|
||||||
#include "TalentExecutive.h"
|
#include "TalentExecutive.h"
|
||||||
@@ -1,3 +1,10 @@
|
|||||||
|
/*
|
||||||
|
File: TalentExecutive.h
|
||||||
|
* Description : Represents information related to a talent executive in the system.
|
||||||
|
* Author : Trenser
|
||||||
|
* Created : 31-Mar-2026
|
||||||
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "Employee.h"
|
#include "Employee.h"
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,13 @@
|
|||||||
|
/*
|
||||||
|
File: Team.cpp
|
||||||
|
* Description : Models a team entity that maintains team identity, leadership, employee list, and size limitations.
|
||||||
|
* Author : Trenser
|
||||||
|
* Created : 31-Mar-2026
|
||||||
|
*/
|
||||||
|
|
||||||
#include "Team.h"
|
#include "Team.h"
|
||||||
|
|
||||||
|
//Getters and setters
|
||||||
const std::string& Team::getTeamId() const
|
const std::string& Team::getTeamId() const
|
||||||
{
|
{
|
||||||
return m_id;
|
return m_id;
|
||||||
@@ -10,7 +18,7 @@ const std::string& Team::getTeamName() const
|
|||||||
return m_name;
|
return m_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<Employee> Team::getTeamLead() const
|
Employee* Team::getTeamLead() const
|
||||||
{
|
{
|
||||||
return m_lead;
|
return m_lead;
|
||||||
}
|
}
|
||||||
@@ -35,7 +43,7 @@ void Team::setTeamName(const std::string& name)
|
|||||||
m_name = name;
|
m_name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Team::setTeamLead(std::shared_ptr<Employee> lead)
|
void Team::setTeamLead(Employee* lead)
|
||||||
{
|
{
|
||||||
m_lead = lead;
|
m_lead = lead;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,34 +1,41 @@
|
|||||||
|
/*
|
||||||
|
File: Team.h
|
||||||
|
* Description : Models a team entity that maintains team identity, leadership, employee list, and size limitations.
|
||||||
|
* Author : Trenser
|
||||||
|
* Created : 31-Mar-2026
|
||||||
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include "Employee.h"
|
#include "Employee.h"
|
||||||
using employeeMap = std::map<std::string, std::shared_ptr<Employee>>;
|
using employeeMap = std::map<std::string, Employee*>;
|
||||||
|
|
||||||
class Team
|
class Team
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
std::string m_id;
|
std::string m_id;
|
||||||
std::string m_name;
|
std::string m_name;
|
||||||
std::shared_ptr<Employee> m_lead;
|
Employee* m_lead;
|
||||||
employeeMap m_employees;
|
employeeMap m_employees;
|
||||||
int m_maximumNumberOfEmployees;
|
int m_maximumNumberOfEmployees;
|
||||||
public:
|
public:
|
||||||
Team() : m_id(""), m_name(""), m_lead(nullptr), m_maximumNumberOfEmployees(0) {}
|
Team() : m_id(""), m_name(""), m_lead(nullptr), m_maximumNumberOfEmployees(0) {}
|
||||||
Team(const std::string& id,
|
Team(const std::string& id,
|
||||||
const std::string& name,
|
const std::string& name,
|
||||||
std::shared_ptr<Employee> lead,
|
Employee* lead,
|
||||||
int maximumNumberOfEmployees)
|
int maximumNumberOfEmployees)
|
||||||
: m_id(id), m_name(name), m_lead(lead), m_maximumNumberOfEmployees(maximumNumberOfEmployees) {
|
: m_id(id), 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;
|
||||||
std::shared_ptr<Employee> getTeamLead() const;
|
Employee* getTeamLead() const;
|
||||||
const employeeMap& getEmployeesInTeam() const;
|
const employeeMap& getEmployeesInTeam() const;
|
||||||
int getMaximumNumberOfEmployeesInTeam() const;
|
int getMaximumNumberOfEmployeesInTeam() const;
|
||||||
void setTeamId(const std::string& id);
|
void setTeamId(const std::string& id);
|
||||||
void setTeamName(const std::string& name);
|
void setTeamName(const std::string& name);
|
||||||
void setTeamLead(std::shared_ptr<Employee> lead);
|
void setTeamLead(Employee* lead);
|
||||||
void setEmployeesInTeam(const employeeMap& employees);
|
void setEmployeesInTeam(const employeeMap& employees);
|
||||||
void setMaximumNumberOfEmployeesInTeam(int maximumNumberOfEmployees);
|
void setMaximumNumberOfEmployeesInTeam(int maximumNumberOfEmployees);
|
||||||
};
|
};
|
||||||
@@ -1 +1,8 @@
|
|||||||
|
/*
|
||||||
|
File: TeamExecutive.cpp
|
||||||
|
* Description : Represents information related to a team executive within the system.
|
||||||
|
* Author : Trenser
|
||||||
|
* Created : 31-Mar-2026
|
||||||
|
*/
|
||||||
|
|
||||||
#include "TeamExecutive.h"
|
#include "TeamExecutive.h"
|
||||||
@@ -1,3 +1,10 @@
|
|||||||
|
/*
|
||||||
|
File: TeamExecutive.h
|
||||||
|
* Description : Represents information related to a team executive within the system.
|
||||||
|
* Author : Trenser
|
||||||
|
* Created : 31-Mar-2026
|
||||||
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "Employee.h"
|
#include "Employee.h"
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,13 @@
|
|||||||
|
/*
|
||||||
|
File: Ticket.cpp
|
||||||
|
* Description : Represents a support ticket with its associated details and status.
|
||||||
|
* Author : Trenser
|
||||||
|
* Created : 31-Mar-2026
|
||||||
|
*/
|
||||||
|
|
||||||
#include "Ticket.h"
|
#include "Ticket.h"
|
||||||
|
|
||||||
|
//Getters and setters
|
||||||
const std::string& Ticket::getTicketId() const
|
const std::string& Ticket::getTicketId() const
|
||||||
{
|
{
|
||||||
return m_id;
|
return m_id;
|
||||||
|
|||||||
@@ -1,3 +1,10 @@
|
|||||||
|
/*
|
||||||
|
File: Ticket.h
|
||||||
|
* Description : Represents a support ticket with its associated details and status.
|
||||||
|
* Author : Trenser
|
||||||
|
* Created : 31-Mar-2026
|
||||||
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <string>
|
#include <string>
|
||||||
#include "Enums.h"
|
#include "Enums.h"
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ AuthenticationDTO AuthenticationManagementService::login(const std::string& emai
|
|||||||
employeeType = employee.second->getEmployeeType();
|
employeeType = employee.second->getEmployeeType();
|
||||||
if (employeeType == Enums::EmployeeType::GENERAL)
|
if (employeeType == Enums::EmployeeType::GENERAL)
|
||||||
{
|
{
|
||||||
std::shared_ptr<GeneralEmployee> generalEmployee = std::dynamic_pointer_cast<GeneralEmployee>(employee.second);
|
GeneralEmployee* generalEmployee = dynamic_cast<GeneralEmployee*>(employee.second);
|
||||||
if (generalEmployee)
|
if (generalEmployee)
|
||||||
{
|
{
|
||||||
employeeDesignation = generalEmployee->getDesignation();
|
employeeDesignation = generalEmployee->getDesignation();
|
||||||
@@ -77,7 +77,7 @@ AuthenticationDTO AuthenticationManagementService::login(const std::string& emai
|
|||||||
*/
|
*/
|
||||||
void AuthenticationManagementService::changePassword(const std::string& password)
|
void AuthenticationManagementService::changePassword(const std::string& password)
|
||||||
{
|
{
|
||||||
std::shared_ptr<Employee> authenticatedUser = m_dataStore.getAuthenticatedUser();
|
Employee* authenticatedUser = m_dataStore.getAuthenticatedUser();
|
||||||
if (authenticatedUser)
|
if (authenticatedUser)
|
||||||
{
|
{
|
||||||
authenticatedUser->setEmployeePassword(password);
|
authenticatedUser->setEmployeePassword(password);
|
||||||
@@ -99,10 +99,12 @@ void AuthenticationManagementService::changePassword(const std::string& password
|
|||||||
* runtime_error if no user is currently logged in
|
* runtime_error if no user is currently logged in
|
||||||
*/
|
*/
|
||||||
void AuthenticationManagementService::logout() {
|
void AuthenticationManagementService::logout() {
|
||||||
if (m_dataStore.getAuthenticatedUser()) {
|
if (m_dataStore.getAuthenticatedEmployee())
|
||||||
m_dataStore.getAuthenticatedUser() = nullptr;
|
{
|
||||||
|
m_dataStore.getAuthenticatedEmployee() = nullptr;
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
throw std::runtime_error("No user currently logged In...");
|
throw std::runtime_error("No user currently logged In...");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -14,6 +14,6 @@ void LogService::log(const std::string& message)
|
|||||||
{
|
{
|
||||||
DataStore& dataStore = DataStore::getInstance();
|
DataStore& dataStore = DataStore::getInstance();
|
||||||
logMap& logs = dataStore.getLogs();
|
logMap& logs = dataStore.getLogs();
|
||||||
std::shared_ptr<Log> log = Factory::getObject<Log>(message);
|
Log* log = Factory::getObject<Log>(message);
|
||||||
logs.emplace(std::make_pair(log->getTimestamp(), log));
|
logs.emplace(std::make_pair(log->getTimestamp(), log));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,10 @@
|
|||||||
|
/*
|
||||||
|
* File: Enums.h
|
||||||
|
* Description: Defines strongly typed enumerations for statuses, types, and designations used across the HRMS system.
|
||||||
|
* Author: Smitha
|
||||||
|
* Created: 01-04-2026
|
||||||
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
namespace Enums {
|
namespace Enums {
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
#pragma once
|
/*
|
||||||
|
* File: InputHelper.h
|
||||||
|
* Description: Handles input validation and error handling
|
||||||
|
* Author: Smitha
|
||||||
|
* Created: 08-Apr-2026
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
#include <string>
|
#include <string>
|
||||||
@@ -7,6 +13,15 @@
|
|||||||
|
|
||||||
namespace util
|
namespace util
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
|
* Function: read
|
||||||
|
* Description: Reads input from console into a variable of type T.
|
||||||
|
* Parameters:
|
||||||
|
* value - reference to a variable of type T where the input will be stored
|
||||||
|
* Returns:
|
||||||
|
* void - throws runtime_error if input is invalid
|
||||||
|
*/
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
inline void read(T& value)
|
inline void read(T& value)
|
||||||
{
|
{
|
||||||
@@ -18,11 +33,27 @@ namespace util
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function: read
|
||||||
|
* Description: Reads a line of text input from console into a string.
|
||||||
|
* Parameters:
|
||||||
|
* value - reference to a string where the input will be stored
|
||||||
|
* Returns:
|
||||||
|
* void - no return value
|
||||||
|
*/
|
||||||
|
|
||||||
inline void read(std::string& value)
|
inline void read(std::string& value)
|
||||||
{
|
{
|
||||||
std::getline(std::cin >> std::ws, value);
|
std::getline(std::cin >> std::ws, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function: pressEnter
|
||||||
|
* Description: Pauses execution until the user presses Enter.
|
||||||
|
* Parameters: None
|
||||||
|
* Returns: void - no return value
|
||||||
|
*/
|
||||||
|
|
||||||
inline void pressEnter()
|
inline void pressEnter()
|
||||||
{
|
{
|
||||||
system("pause");
|
system("pause");
|
||||||
|
|||||||
@@ -1,5 +1,20 @@
|
|||||||
|
/*
|
||||||
|
* File: OutputHelper.cpp
|
||||||
|
* Description: Provides functions to help with console output.
|
||||||
|
* Author: Trenser
|
||||||
|
* Created: 01-04-2026
|
||||||
|
*/
|
||||||
|
|
||||||
#include "outputHelper.h"
|
#include "outputHelper.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function: clear
|
||||||
|
* Description: Clears the console screen output.
|
||||||
|
* Parameters: None
|
||||||
|
* Returns:
|
||||||
|
* void - no return value
|
||||||
|
*/
|
||||||
|
|
||||||
void util::clear()
|
void util::clear()
|
||||||
{
|
{
|
||||||
std::cout << "\x1B[2J\x1B[H" << std::flush;
|
std::cout << "\x1B[2J\x1B[H" << std::flush;
|
||||||
|
|||||||
@@ -1,3 +1,10 @@
|
|||||||
|
/*
|
||||||
|
* File: OutputHelper.h
|
||||||
|
* Description: Provides functions to help with console output.
|
||||||
|
* Author: Trenser
|
||||||
|
* Created: 01-04-2026
|
||||||
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
|||||||
@@ -1,18 +1,56 @@
|
|||||||
|
/*
|
||||||
|
* File: Timestamp.cpp
|
||||||
|
* Description: Provides a utility class for representing and manipulating time values.
|
||||||
|
* Supports conversion between string and time formats, duration calculations
|
||||||
|
* (hours, minutes, seconds), date extraction, and comparison operators.
|
||||||
|
* Author: Trenser
|
||||||
|
* Created: 01-Apr-2026
|
||||||
|
*/
|
||||||
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include "Timestamp.h"
|
#include "Timestamp.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function: Timestamp
|
||||||
|
* Description: Default constructor that initializes the timestamp to the current system time.
|
||||||
|
* Parameters:
|
||||||
|
* None
|
||||||
|
* Returns:
|
||||||
|
* Timestamp object
|
||||||
|
*/
|
||||||
|
|
||||||
util::Timestamp::Timestamp()
|
util::Timestamp::Timestamp()
|
||||||
{
|
{
|
||||||
m_time = std::time(nullptr);
|
m_time = std::time(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function: Timestamp (overloaded)
|
||||||
|
* Description: Constructor that initializes the timestamp with a given time value.
|
||||||
|
* Parameters:
|
||||||
|
* timeValue - time_t value representing a specific time
|
||||||
|
* Returns:
|
||||||
|
* Timestamp object
|
||||||
|
*/
|
||||||
|
|
||||||
util::Timestamp::Timestamp(std::time_t timeValue)
|
util::Timestamp::Timestamp(std::time_t timeValue)
|
||||||
{
|
{
|
||||||
m_time = timeValue;
|
m_time = timeValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function: fromString
|
||||||
|
* Description: Creates a Timestamp object from a formatted string.
|
||||||
|
* Parameters:
|
||||||
|
* timeString - string in the format "YYYY-MM-DD HH:MM:SS"
|
||||||
|
* Returns:
|
||||||
|
* Timestamp object representing the parsed time
|
||||||
|
* Throws:
|
||||||
|
* runtime_error if the string format is invalid
|
||||||
|
*/
|
||||||
|
|
||||||
util::Timestamp util::Timestamp::fromString(const std::string& timeString)
|
util::Timestamp util::Timestamp::fromString(const std::string& timeString)
|
||||||
{
|
{
|
||||||
std::tm timeStruct = {};
|
std::tm timeStruct = {};
|
||||||
@@ -26,6 +64,15 @@ util::Timestamp util::Timestamp::fromString(const std::string& timeString)
|
|||||||
return Timestamp(parsedTimestamp);
|
return Timestamp(parsedTimestamp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function: toString
|
||||||
|
* Description: Converts the Timestamp object into a formatted string.
|
||||||
|
* Parameters:
|
||||||
|
* None
|
||||||
|
* Returns:
|
||||||
|
* string - formatted as "YYYY-MM-DD HH:MM:SS"
|
||||||
|
*/
|
||||||
|
|
||||||
std::string util::Timestamp::toString() const
|
std::string util::Timestamp::toString() const
|
||||||
{
|
{
|
||||||
std::tm timeStruct = {};
|
std::tm timeStruct = {};
|
||||||
@@ -35,11 +82,30 @@ std::string util::Timestamp::toString() const
|
|||||||
return outputStream.str();
|
return outputStream.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function: getDurationInSeconds
|
||||||
|
* Description: Calculates the duration between two timestamps in seconds.
|
||||||
|
* Parameters:
|
||||||
|
* startTimestamp - starting time
|
||||||
|
* endTimestamp - ending time
|
||||||
|
* Returns:
|
||||||
|
* double - duration in seconds
|
||||||
|
*/
|
||||||
|
|
||||||
double util::Timestamp::getDurationInSeconds(const Timestamp& startTimestamp, const Timestamp& endTimestamp)
|
double util::Timestamp::getDurationInSeconds(const Timestamp& startTimestamp, const Timestamp& endTimestamp)
|
||||||
{
|
{
|
||||||
return std::difftime(endTimestamp.m_time, startTimestamp.m_time);
|
return std::difftime(endTimestamp.m_time, startTimestamp.m_time);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function: getDateAsInt
|
||||||
|
* Description: Returns the date portion of the timestamp as an integer in YYYYMMDD format.
|
||||||
|
* Parameters:
|
||||||
|
* None
|
||||||
|
* Returns:
|
||||||
|
* int - date as YYYYMMDD
|
||||||
|
*/
|
||||||
|
|
||||||
int util::Timestamp::getDateAsInt() const
|
int util::Timestamp::getDateAsInt() const
|
||||||
{
|
{
|
||||||
std::tm timeStruct{};
|
std::tm timeStruct{};
|
||||||
@@ -50,36 +116,101 @@ int util::Timestamp::getDateAsInt() const
|
|||||||
return year * 10000 + month * 100 + day;
|
return year * 10000 + month * 100 + day;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function: getDurationInMinutes
|
||||||
|
* Description: Calculates the duration between two timestamps in minutes.
|
||||||
|
* Parameters:
|
||||||
|
* startTimestamp - starting time
|
||||||
|
* endTimestamp - ending time
|
||||||
|
* Returns:
|
||||||
|
* double - duration in minutes
|
||||||
|
*/
|
||||||
|
|
||||||
double util::Timestamp::getDurationInMinutes(const Timestamp& startTimestamp, const Timestamp& endTimestamp)
|
double util::Timestamp::getDurationInMinutes(const Timestamp& startTimestamp, const Timestamp& endTimestamp)
|
||||||
{
|
{
|
||||||
return getDurationInSeconds(startTimestamp, endTimestamp) / 60.0;
|
return getDurationInSeconds(startTimestamp, endTimestamp) / 60.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function: getDurationInHours
|
||||||
|
* Description: Calculates the duration between two timestamps in hours.
|
||||||
|
* Parameters:
|
||||||
|
* startTimestamp - starting time
|
||||||
|
* endTimestamp - ending time
|
||||||
|
* Returns:
|
||||||
|
* double - duration in hours
|
||||||
|
*/
|
||||||
|
|
||||||
double util::Timestamp::getDurationInHours(const Timestamp& startTimestamp, const Timestamp& endTimestamp)
|
double util::Timestamp::getDurationInHours(const Timestamp& startTimestamp, const Timestamp& endTimestamp)
|
||||||
{
|
{
|
||||||
return getDurationInSeconds(startTimestamp, endTimestamp) / 3600.0;
|
return getDurationInSeconds(startTimestamp, endTimestamp) / 3600.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function: operator<
|
||||||
|
* Description: Compares two timestamps to check if one is earlier than the other.
|
||||||
|
* Parameters:
|
||||||
|
* other - Timestamp to compare against
|
||||||
|
* Returns:
|
||||||
|
* bool - true if current timestamp is earlier
|
||||||
|
*/
|
||||||
|
|
||||||
bool util::Timestamp::operator<(const Timestamp& other) const
|
bool util::Timestamp::operator<(const Timestamp& other) const
|
||||||
{
|
{
|
||||||
return m_time < other.m_time;
|
return m_time < other.m_time;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function: operator>
|
||||||
|
* Description: Compares two timestamps to check if one is later than the other.
|
||||||
|
* Parameters:
|
||||||
|
* other - Timestamp to compare against
|
||||||
|
* Returns:
|
||||||
|
* bool - true if current timestamp is later
|
||||||
|
*/
|
||||||
|
|
||||||
bool util::Timestamp::operator>(const Timestamp& other) const
|
bool util::Timestamp::operator>(const Timestamp& other) const
|
||||||
{
|
{
|
||||||
return m_time > other.m_time;
|
return m_time > other.m_time;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function: operator<=
|
||||||
|
* Description: Compares two timestamps to check if one is earlier or equal.
|
||||||
|
* Parameters:
|
||||||
|
* other - Timestamp to compare against
|
||||||
|
* Returns:
|
||||||
|
* bool - true if current timestamp is earlier or equal
|
||||||
|
*/
|
||||||
|
|
||||||
bool util::Timestamp::operator<=(const Timestamp& other) const
|
bool util::Timestamp::operator<=(const Timestamp& other) const
|
||||||
{
|
{
|
||||||
return m_time <= other.m_time;
|
return m_time <= other.m_time;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function: operator>=
|
||||||
|
* Description: Compares two timestamps to check if one is later or equal.
|
||||||
|
* Parameters:
|
||||||
|
* other - Timestamp to compare against
|
||||||
|
* Returns:
|
||||||
|
* bool - true if current timestamp is later or equal
|
||||||
|
*/
|
||||||
|
|
||||||
bool util::Timestamp::operator>=(const Timestamp& other) const
|
bool util::Timestamp::operator>=(const Timestamp& other) const
|
||||||
{
|
{
|
||||||
return m_time >= other.m_time;
|
return m_time >= other.m_time;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function: operator==
|
||||||
|
* Description: Compares two timestamps for equality.
|
||||||
|
* Parameters:
|
||||||
|
* other - Timestamp to compare against
|
||||||
|
* Returns:
|
||||||
|
* bool - true if both timestamps are equal
|
||||||
|
*/
|
||||||
|
|
||||||
bool util::Timestamp::operator==(const Timestamp& other) const
|
bool util::Timestamp::operator==(const Timestamp& other) const
|
||||||
{
|
{
|
||||||
return m_time == other.m_time;
|
return m_time == other.m_time;
|
||||||
|
|||||||
@@ -1,3 +1,12 @@
|
|||||||
|
/*
|
||||||
|
* File: Timestamp.h
|
||||||
|
* Description: Provides a utility class for representing and manipulating time values.
|
||||||
|
* Supports conversion between string and time formats, duration calculations
|
||||||
|
* (hours, minutes, seconds), date extraction, and comparison operators.
|
||||||
|
* Author: Trenser
|
||||||
|
* Created: 01-Apr-2026
|
||||||
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|||||||
@@ -1,8 +1,24 @@
|
|||||||
|
/*
|
||||||
|
* File: Validator.cpp
|
||||||
|
* Description: Validates inputs like phone number, email, password
|
||||||
|
* Author: Trenser
|
||||||
|
* Created: 01-Apr-2026
|
||||||
|
*/
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <cctype>
|
#include <cctype>
|
||||||
#include "Validator.h"
|
#include "Validator.h"
|
||||||
#include "ApplicationConfig.h"
|
#include "ApplicationConfig.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function: isPhoneNumberValid
|
||||||
|
* Description: Validates whether the given string is a valid phone number.
|
||||||
|
* Parameters:
|
||||||
|
* phoneNumber - string containing the phone number to validate
|
||||||
|
* Returns:
|
||||||
|
* bool - true if the phone number is valid (10 digits, all numeric), false otherwise
|
||||||
|
*/
|
||||||
|
|
||||||
bool util::isPhoneNumberValid(const std::string& phoneNumber) {
|
bool util::isPhoneNumberValid(const std::string& phoneNumber) {
|
||||||
if (phoneNumber.size() != 10)
|
if (phoneNumber.size() != 10)
|
||||||
{
|
{
|
||||||
@@ -16,6 +32,15 @@ bool util::isPhoneNumberValid(const std::string& phoneNumber) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function: isEmailValid
|
||||||
|
* Description: Validates whether the given string is a properly formatted email address.
|
||||||
|
* Parameters:
|
||||||
|
* email - string containing the email address to validate
|
||||||
|
* Returns:
|
||||||
|
* bool - true if the email contains exactly one '@' character and is not at the start or end, false otherwise
|
||||||
|
*/
|
||||||
|
|
||||||
bool util::isEmailValid(const std::string& email) {
|
bool util::isEmailValid(const std::string& email) {
|
||||||
size_t index = email.find('@');
|
size_t index = email.find('@');
|
||||||
if (index == std::string::npos) return false;
|
if (index == std::string::npos) return false;
|
||||||
@@ -30,6 +55,19 @@ bool util::isEmailValid(const std::string& email) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function: isPasswordValid
|
||||||
|
* Description: Validates whether the given string meets password requirements.
|
||||||
|
* Parameters:
|
||||||
|
* password - string containing the password to validate
|
||||||
|
* Returns:
|
||||||
|
* bool - true if the password is valid, false otherwise
|
||||||
|
* Notes:
|
||||||
|
* - Must not equal the default password
|
||||||
|
* - Must be at least 8 characters long
|
||||||
|
* - Must contain at least one uppercase letter, one lowercase letter, one digit, and one special character
|
||||||
|
* - Must not contain whitespace
|
||||||
|
*/
|
||||||
|
|
||||||
bool util::isPasswordValid(const std::string& password)
|
bool util::isPasswordValid(const std::string& password)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,3 +1,10 @@
|
|||||||
|
/*
|
||||||
|
* File: Validator.h
|
||||||
|
* Description: Validates inputs like phone number, email, password
|
||||||
|
* Author: Trenser
|
||||||
|
* Created: 01-Apr-2026
|
||||||
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include<string>
|
#include<string>
|
||||||
#include<algorithm>
|
#include<algorithm>
|
||||||
|
|||||||
@@ -1,8 +1,24 @@
|
|||||||
|
/*
|
||||||
|
* File: AdminMenu.cpp
|
||||||
|
* Description: Handles user-related operations such as creation, authentication, and validation.
|
||||||
|
* Author: Trenser
|
||||||
|
* Created: 02-Apr-2026
|
||||||
|
*/
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include "AdminMenu.h"
|
#include "AdminMenu.h"
|
||||||
#include"InputHelper.h"
|
#include"InputHelper.h"
|
||||||
#include"OutputHelper.h"
|
#include"OutputHelper.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function: AdminMenu::run
|
||||||
|
* Description: Starts and manages the administrator menu loop. Continuously displays
|
||||||
|
* options to the administrator until logout is selected or an exception occurs.
|
||||||
|
* Parameters:
|
||||||
|
* None
|
||||||
|
* Returns:
|
||||||
|
* None
|
||||||
|
*/
|
||||||
void AdminMenu::run()
|
void AdminMenu::run()
|
||||||
{
|
{
|
||||||
bool isMenuActive = true;
|
bool isMenuActive = true;
|
||||||
@@ -27,6 +43,15 @@ void AdminMenu::run()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function: AdminMenu::handleOperation
|
||||||
|
* Description: Processes the administrator’s menu choice and executes the corresponding action.
|
||||||
|
* Parameters:
|
||||||
|
* choice - integer representing the selected menu option
|
||||||
|
* Returns:
|
||||||
|
* true - if the menu should remain active
|
||||||
|
* false - if the administrator chooses to logout
|
||||||
|
*/
|
||||||
bool AdminMenu::handleOperation(int choice)
|
bool AdminMenu::handleOperation(int choice)
|
||||||
{
|
{
|
||||||
switch (choice)
|
switch (choice)
|
||||||
|
|||||||
@@ -1,13 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* File: AdminMenu.h
|
||||||
|
* Description: Declaration of the AdminMenu class and related functions.
|
||||||
|
* Author: Trenser
|
||||||
|
* Created: 02-Apr-2026
|
||||||
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include<memory>
|
|
||||||
#include"ZenvyController.h"
|
#include"ZenvyController.h"
|
||||||
|
|
||||||
class AdminMenu
|
class AdminMenu
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
std::shared_ptr<ZenvyController> m_zenvyController;
|
ZenvyController* m_zenvyController;
|
||||||
public:
|
public:
|
||||||
AdminMenu() :m_zenvyController(std::make_shared<ZenvyController>()) {};
|
AdminMenu() :m_zenvyController(new ZenvyController()) {};
|
||||||
void run();
|
void run();
|
||||||
bool handleOperation(int);
|
bool handleOperation(int);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,8 +1,23 @@
|
|||||||
|
/*
|
||||||
|
* File: EmployeeMenu.cpp
|
||||||
|
* Description: Implements the EmployeeMenu class functions including menu loop and operation handling.
|
||||||
|
* Author: Trenser
|
||||||
|
* Created: 02-Apr-2026
|
||||||
|
*/
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include "EmployeeMenu.h"
|
#include "EmployeeMenu.h"
|
||||||
#include"InputHelper.h"
|
#include"InputHelper.h"
|
||||||
#include"OutputHelper.h"
|
#include"OutputHelper.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function: EmployeeMenu::run
|
||||||
|
* Description: Starts the employee menu loop and displays available options until logout is selected
|
||||||
|
* Parameters:
|
||||||
|
* None
|
||||||
|
* Returns:
|
||||||
|
* None
|
||||||
|
*/
|
||||||
void EmployeeMenu::run()
|
void EmployeeMenu::run()
|
||||||
{
|
{
|
||||||
bool isMenuActive = true;
|
bool isMenuActive = true;
|
||||||
@@ -27,6 +42,15 @@ void EmployeeMenu::run()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function: EmployeeMenu::handleOperation
|
||||||
|
* Description: Handles the employee’s menu choice and executes the corresponding action
|
||||||
|
* Parameters:
|
||||||
|
* choice - integer representing the selected menu option
|
||||||
|
* Returns:
|
||||||
|
* true - if the menu should remain active
|
||||||
|
* false - if the employee chooses to logout
|
||||||
|
*/
|
||||||
bool EmployeeMenu::handleOperation(int choice)
|
bool EmployeeMenu::handleOperation(int choice)
|
||||||
{
|
{
|
||||||
switch (choice)
|
switch (choice)
|
||||||
|
|||||||
@@ -1,13 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* File: EmployeeMenu.h
|
||||||
|
* Description: Declaration of the EmployeeMenu class and related functions.
|
||||||
|
* Author: Trenser
|
||||||
|
* Created: 02-Apr-2026
|
||||||
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include<memory>
|
|
||||||
#include"ZenvyController.h"
|
#include"ZenvyController.h"
|
||||||
|
|
||||||
class EmployeeMenu
|
class EmployeeMenu
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
std::shared_ptr<ZenvyController> m_zenvyController;
|
ZenvyController m_zenvyController;
|
||||||
public:
|
public:
|
||||||
EmployeeMenu() : m_zenvyController(std::make_shared<ZenvyController>()) {};
|
EmployeeMenu() : m_zenvyController(new ZenvyController()) {};
|
||||||
void run();
|
void run();
|
||||||
bool handleOperation(int);
|
bool handleOperation(int);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,8 +1,23 @@
|
|||||||
|
/*
|
||||||
|
* File: FinanceExecutiveMenu.cpp
|
||||||
|
* Description: Implements the FinanceExecutiveMenu class functions including menu loop and operation handling.
|
||||||
|
* Author: Trenser
|
||||||
|
* Created: 02-Apr-2026
|
||||||
|
*/
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include "FinanceExecutiveMenu.h"
|
#include "FinanceExecutiveMenu.h"
|
||||||
#include"InputHelper.h"
|
#include"InputHelper.h"
|
||||||
#include"OutputHelper.h"
|
#include"OutputHelper.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function: FinanceExecutiveMenu::run
|
||||||
|
* Description: Starts the finance executive menu loop and displays available options until logout is selected
|
||||||
|
* Parameters:
|
||||||
|
* None
|
||||||
|
* Returns:
|
||||||
|
* None
|
||||||
|
*/
|
||||||
void FinanceExecutiveMenu::run()
|
void FinanceExecutiveMenu::run()
|
||||||
{
|
{
|
||||||
bool isMenuActive = true;
|
bool isMenuActive = true;
|
||||||
@@ -27,6 +42,15 @@ void FinanceExecutiveMenu::run()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function: FinanceExecutiveMenu::handleOperation
|
||||||
|
* Description: Handles the finance executive’s menu choice and executes the corresponding action
|
||||||
|
* Parameters:
|
||||||
|
* choice - integer representing the selected menu option
|
||||||
|
* Returns:
|
||||||
|
* true - if the menu should remain active
|
||||||
|
* false - if the finance executive chooses to logout
|
||||||
|
*/
|
||||||
bool FinanceExecutiveMenu::handleOperation(int choice)
|
bool FinanceExecutiveMenu::handleOperation(int choice)
|
||||||
{
|
{
|
||||||
switch (choice)
|
switch (choice)
|
||||||
|
|||||||
@@ -1,13 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* File: FinanceExecutiveMenu.h
|
||||||
|
* Description: Declaration of the FinanceExecutiveMenu class and related functions.
|
||||||
|
* Author: Trenser
|
||||||
|
* Created: 02-Apr-2026
|
||||||
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include<memory>
|
|
||||||
#include"ZenvyController.h"
|
#include"ZenvyController.h"
|
||||||
|
|
||||||
class FinanceExecutiveMenu
|
class FinanceExecutiveMenu
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
std::shared_ptr<ZenvyController> m_zenvyController;
|
ZenvyController* m_zenvyController;
|
||||||
public:
|
public:
|
||||||
FinanceExecutiveMenu() : m_zenvyController(std::make_shared<ZenvyController>()) {};
|
FinanceExecutiveMenu() : m_zenvyController(new ZenvyController()) {};
|
||||||
void run();
|
void run();
|
||||||
bool handleOperation(int);
|
bool handleOperation(int);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,8 +1,23 @@
|
|||||||
|
/*
|
||||||
|
* File: HRManagerMenu.cpp
|
||||||
|
* Description: Implements the HRManagerMenu class functions including menu loop and operation handling.
|
||||||
|
* Author: Trenser
|
||||||
|
* Created: 02-Apr-2026
|
||||||
|
*/
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include "HRManagerMenu.h"
|
#include "HRManagerMenu.h"
|
||||||
#include"InputHelper.h"
|
#include"InputHelper.h"
|
||||||
#include"OutputHelper.h"
|
#include"OutputHelper.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function: HRManagerMenu::run
|
||||||
|
* Description: Starts the HR manager menu loop and displays available options until logout is selected
|
||||||
|
* Parameters:
|
||||||
|
* None
|
||||||
|
* Returns:
|
||||||
|
* None
|
||||||
|
*/
|
||||||
void HRManagerMenu::run()
|
void HRManagerMenu::run()
|
||||||
{
|
{
|
||||||
bool isMenuActive = true;
|
bool isMenuActive = true;
|
||||||
@@ -27,6 +42,15 @@ void HRManagerMenu::run()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function: HRManagerMenu::handleOperation
|
||||||
|
* Description: Handles the HR manager’s menu choice and executes the corresponding action
|
||||||
|
* Parameters:
|
||||||
|
* choice - integer representing the selected menu option
|
||||||
|
* Returns:
|
||||||
|
* true - if the menu should remain active
|
||||||
|
* false - if the HR manager chooses to logout
|
||||||
|
*/
|
||||||
bool HRManagerMenu::handleOperation(int choice)
|
bool HRManagerMenu::handleOperation(int choice)
|
||||||
{
|
{
|
||||||
switch (choice)
|
switch (choice)
|
||||||
|
|||||||
@@ -1,13 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* File: HRManagerMenu.h
|
||||||
|
* Description: Declaration of the EmployeeMenu class and related functions.
|
||||||
|
* Author: Trenser
|
||||||
|
* Created: 02-Apr-2026
|
||||||
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include<memory>
|
|
||||||
#include"ZenvyController.h"
|
#include"ZenvyController.h"
|
||||||
|
|
||||||
class HRManagerMenu
|
class HRManagerMenu
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
std::shared_ptr<ZenvyController> m_zenvyController;
|
ZenvyController* m_zenvyController;
|
||||||
public:
|
public:
|
||||||
HRManagerMenu() : m_zenvyController(std::make_shared<ZenvyController>()) {};
|
HRManagerMenu() : m_zenvyController(new ZenvyController()) {};
|
||||||
void run();
|
void run();
|
||||||
bool handleOperation(int);
|
bool handleOperation(int);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,8 +1,23 @@
|
|||||||
|
/*
|
||||||
|
* File: ITExecutiveMenu.cpp
|
||||||
|
* Description: Implements the ITExecutiveMenu class functions including menu loop and operation handling.
|
||||||
|
* Author: Trenser
|
||||||
|
* Created: 02-Apr-2026
|
||||||
|
*/
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include "ITExecutiveMenu.h"
|
#include "ITExecutiveMenu.h"
|
||||||
#include"InputHelper.h"
|
#include"InputHelper.h"
|
||||||
#include"OutputHelper.h"
|
#include"OutputHelper.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function: ITExecutiveMenu::run
|
||||||
|
* Description: Starts the IT executive menu loop and displays available options until logout is selected
|
||||||
|
* Parameters:
|
||||||
|
* None
|
||||||
|
* Returns:
|
||||||
|
* None
|
||||||
|
*/
|
||||||
void ITExecutiveMenu::run()
|
void ITExecutiveMenu::run()
|
||||||
{
|
{
|
||||||
bool isMenuActive = true;
|
bool isMenuActive = true;
|
||||||
@@ -27,6 +42,15 @@ void ITExecutiveMenu::run()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function: ITExecutiveMenu::handleOperation
|
||||||
|
* Description: Handles the IT executive’s menu choice and executes the corresponding action
|
||||||
|
* Parameters:
|
||||||
|
* choice - integer representing the selected menu option
|
||||||
|
* Returns:
|
||||||
|
* true - if the menu should remain active
|
||||||
|
* false - if the IT executive chooses to logout
|
||||||
|
*/
|
||||||
bool ITExecutiveMenu::handleOperation(int choice)
|
bool ITExecutiveMenu::handleOperation(int choice)
|
||||||
{
|
{
|
||||||
switch (choice)
|
switch (choice)
|
||||||
|
|||||||
@@ -1,13 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* File: ITExecutiveMenu.h
|
||||||
|
* Description: Declaration of the ITExecutiveMenu class and related functions.
|
||||||
|
* Author: Trenser
|
||||||
|
* Created: 02-Apr-2026
|
||||||
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include<memory>
|
|
||||||
#include"ZenvyController.h"
|
#include"ZenvyController.h"
|
||||||
|
|
||||||
class ITExecutiveMenu
|
class ITExecutiveMenu
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
std::shared_ptr<ZenvyController> m_zenvyController;
|
ZenvyController* m_zenvyController;
|
||||||
public:
|
public:
|
||||||
ITExecutiveMenu() : m_zenvyController(std::make_shared<ZenvyController>()) {};
|
ITExecutiveMenu() : m_zenvyController(new ZenvyController()) {};
|
||||||
void run();
|
void run();
|
||||||
bool handleOperation(int);
|
bool handleOperation(int);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,8 +1,23 @@
|
|||||||
|
/*
|
||||||
|
* File: TalentExecutiveMenu.cpp
|
||||||
|
* Description: Implements the TalentExecutiveMenu class functions including menu loop and operation handling.
|
||||||
|
* Author: Trenser
|
||||||
|
* Created: 02-Apr-2026
|
||||||
|
*/
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include "TalentExecutiveMenu.h"
|
#include "TalentExecutiveMenu.h"
|
||||||
#include"InputHelper.h"
|
#include"InputHelper.h"
|
||||||
#include"OutputHelper.h"
|
#include"OutputHelper.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function: TalentExecutiveMenu::run
|
||||||
|
* Description: Starts the talent executive menu loop and displays available options until logout is selected
|
||||||
|
* Parameters:
|
||||||
|
* None
|
||||||
|
* Returns:
|
||||||
|
* None
|
||||||
|
*/
|
||||||
void TalentExecutiveMenu::run()
|
void TalentExecutiveMenu::run()
|
||||||
{
|
{
|
||||||
bool isMenuActive = true;
|
bool isMenuActive = true;
|
||||||
@@ -27,6 +42,15 @@ void TalentExecutiveMenu::run()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function: TalentExecutiveMenu::handleOperation
|
||||||
|
* Description: Handles the talent executive’s menu choice and executes the corresponding action
|
||||||
|
* Parameters:
|
||||||
|
* choice - integer representing the selected menu option
|
||||||
|
* Returns:
|
||||||
|
* true - if the menu should remain active
|
||||||
|
* false - if the talent executive chooses to logout
|
||||||
|
*/
|
||||||
bool TalentExecutiveMenu::handleOperation(int choice)
|
bool TalentExecutiveMenu::handleOperation(int choice)
|
||||||
{
|
{
|
||||||
switch (choice)
|
switch (choice)
|
||||||
|
|||||||
@@ -1,13 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* File: TalentExecutiveMenu.h
|
||||||
|
* Description: Declaration of the TalentExecutiveMenu class and related functions.
|
||||||
|
* Author: Trenser
|
||||||
|
* Created: 02-Apr-2026
|
||||||
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include<memory>
|
|
||||||
#include"ZenvyController.h"
|
#include"ZenvyController.h"
|
||||||
|
|
||||||
class TalentExecutiveMenu
|
class TalentExecutiveMenu
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
std::shared_ptr<ZenvyController> m_zenvyController;
|
ZenvyController* m_zenvyController;
|
||||||
public:
|
public:
|
||||||
TalentExecutiveMenu() : m_zenvyController(std::make_shared < ZenvyController>()) {};
|
TalentExecutiveMenu() : m_zenvyController(new ZenvyController()) {};
|
||||||
void run();
|
void run();
|
||||||
bool handleOperation(int);
|
bool handleOperation(int);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,8 +1,23 @@
|
|||||||
|
/*
|
||||||
|
* File: TeamExecutiveMenu.cpp
|
||||||
|
* Description: Implements the TeamExecutiveMenu class functions including menu loop and operation handling.
|
||||||
|
* Author: Trenser
|
||||||
|
* Created: 02-Apr-2026
|
||||||
|
*/
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include "TeamExecutiveMenu.h"
|
#include "TeamExecutiveMenu.h"
|
||||||
#include"InputHelper.h"
|
#include"InputHelper.h"
|
||||||
#include"OutputHelper.h"
|
#include"OutputHelper.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function: TeamExecutiveMenu::run
|
||||||
|
* Description: Starts the team executive menu loop and displays available options until logout is selected
|
||||||
|
* Parameters:
|
||||||
|
* None
|
||||||
|
* Returns:
|
||||||
|
* None
|
||||||
|
*/
|
||||||
void TeamExecutiveMenu::run()
|
void TeamExecutiveMenu::run()
|
||||||
{
|
{
|
||||||
bool isMenuActive = true;
|
bool isMenuActive = true;
|
||||||
@@ -27,6 +42,15 @@ void TeamExecutiveMenu::run()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function: TeamExecutiveMenu::handleOperation
|
||||||
|
* Description: Handles the team executive’s menu choice and executes the corresponding action
|
||||||
|
* Parameters:
|
||||||
|
* choice - integer representing the selected menu option
|
||||||
|
* Returns:
|
||||||
|
* true - if the menu should remain active
|
||||||
|
* false - if the team executive chooses to logout
|
||||||
|
*/
|
||||||
bool TeamExecutiveMenu::handleOperation(int choice)
|
bool TeamExecutiveMenu::handleOperation(int choice)
|
||||||
{
|
{
|
||||||
switch (choice)
|
switch (choice)
|
||||||
|
|||||||
@@ -1,13 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* File: TeamExecutiveMenu.h
|
||||||
|
* Description: Declaration of the TeamExecutiveMenu and related functions.
|
||||||
|
* Author: Trenser
|
||||||
|
* Created: 02-Apr-2026
|
||||||
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include<memory>
|
|
||||||
#include"ZenvyController.h"
|
#include"ZenvyController.h"
|
||||||
|
|
||||||
class TeamExecutiveMenu
|
class TeamExecutiveMenu
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
std::shared_ptr<ZenvyController> m_zenvyController;
|
ZenvyController* m_zenvyController;
|
||||||
public:
|
public:
|
||||||
TeamExecutiveMenu() : m_zenvyController(std::make_shared<ZenvyController>()) {};
|
TeamExecutiveMenu() : m_zenvyController(new ZenvyController()) {};
|
||||||
void run();
|
void run();
|
||||||
bool handleOperation(int);
|
bool handleOperation(int);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,8 +1,23 @@
|
|||||||
|
/*
|
||||||
|
* File: TeamLeadMenu.cpp
|
||||||
|
* Description: Implements the TeamLeadMenu class functions including menu loop and operation handling.
|
||||||
|
* Author: Trenser
|
||||||
|
* Created: 02-Apr-2026
|
||||||
|
*/
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include "TeamLeadMenu.h"
|
#include "TeamLeadMenu.h"
|
||||||
#include"InputHelper.h"
|
#include"InputHelper.h"
|
||||||
#include"OutputHelper.h"
|
#include"OutputHelper.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function: TeamLeadMenu::run
|
||||||
|
* Description: Starts the team lead menu loop and displays available options until logout is selected
|
||||||
|
* Parameters:
|
||||||
|
* None
|
||||||
|
* Returns:
|
||||||
|
* None
|
||||||
|
*/
|
||||||
void TeamLeadMenu::run()
|
void TeamLeadMenu::run()
|
||||||
{
|
{
|
||||||
bool isMenuActive = true;
|
bool isMenuActive = true;
|
||||||
@@ -27,6 +42,15 @@ void TeamLeadMenu::run()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function: TeamLeadMenu::handleOperation
|
||||||
|
* Description: Handles the team lead’s menu choice and executes the corresponding action
|
||||||
|
* Parameters:
|
||||||
|
* choice - integer representing the selected menu option
|
||||||
|
* Returns:
|
||||||
|
* true - if the menu should remain active
|
||||||
|
* false - if the team lead chooses to logout
|
||||||
|
*/
|
||||||
bool TeamLeadMenu::handleOperation(int choice)
|
bool TeamLeadMenu::handleOperation(int choice)
|
||||||
{
|
{
|
||||||
switch (choice)
|
switch (choice)
|
||||||
|
|||||||
@@ -1,13 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* File: TeamLeadMenu.h
|
||||||
|
* Description: Declaration of the TeamLeadMenu class and related functions.
|
||||||
|
* Author: Trenser
|
||||||
|
* Created: 02-Apr-2026
|
||||||
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include<memory>
|
|
||||||
#include"ZenvyController.h"
|
#include"ZenvyController.h"
|
||||||
|
|
||||||
class TeamLeadMenu
|
class TeamLeadMenu
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
std::shared_ptr<ZenvyController> m_zenvyController;
|
ZenvyController* m_zenvyController;
|
||||||
public:
|
public:
|
||||||
TeamLeadMenu() : m_zenvyController(std::make_shared<ZenvyController>()) {};
|
TeamLeadMenu() : m_zenvyController(new ZenvyController()) {};
|
||||||
void run();
|
void run();
|
||||||
bool handleOperation(int);
|
bool handleOperation(int);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,6 +1,12 @@
|
|||||||
|
/*
|
||||||
|
* File: UserInterface.cpp
|
||||||
|
* Description: Implements the UserInterface class functions including menu loop, login handling, and routing to appropriate role-based menus.
|
||||||
|
* Author: Trenser
|
||||||
|
* Created: 02-Apr-2026
|
||||||
|
*/
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <memory>
|
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include "UserInterface.h"
|
#include "UserInterface.h"
|
||||||
#include "AdminMenu.h"
|
#include "AdminMenu.h"
|
||||||
@@ -16,6 +22,14 @@
|
|||||||
#include "OutputHelper.h"
|
#include "OutputHelper.h"
|
||||||
#include "Validator.h"
|
#include "Validator.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function: UserInterface::run
|
||||||
|
* Description: Starts the user interface loop and displays login/exit options until exit is selected
|
||||||
|
* Parameters:
|
||||||
|
* None
|
||||||
|
* Returns:
|
||||||
|
* None
|
||||||
|
*/
|
||||||
void UserInterface::run()
|
void UserInterface::run()
|
||||||
{
|
{
|
||||||
bool isMenuActive = true;
|
bool isMenuActive = true;
|
||||||
@@ -40,6 +54,15 @@ void UserInterface::run()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function: UserInterface::handleOperation
|
||||||
|
* Description: Handles the user’s menu choice and executes the corresponding action
|
||||||
|
* Parameters:
|
||||||
|
* choice - integer representing the selected menu option
|
||||||
|
* Returns:
|
||||||
|
* true - if the interface should remain active
|
||||||
|
* false - if the user chooses to exit
|
||||||
|
*/
|
||||||
bool UserInterface::handleOperation(int choice)
|
bool UserInterface::handleOperation(int choice)
|
||||||
{
|
{
|
||||||
switch (choice)
|
switch (choice)
|
||||||
@@ -57,6 +80,14 @@ bool UserInterface::handleOperation(int choice)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function: UserInterface::login
|
||||||
|
* Description: Authenticates the user by email and password, validates login status, and routes to the appropriate menu
|
||||||
|
* Parameters:
|
||||||
|
* None
|
||||||
|
* Returns:
|
||||||
|
* None
|
||||||
|
*/
|
||||||
void UserInterface::login()
|
void UserInterface::login()
|
||||||
{
|
{
|
||||||
std::string email, password;
|
std::string email, password;
|
||||||
@@ -100,7 +131,6 @@ void UserInterface::login()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
util::clear();
|
util::clear();
|
||||||
// Route to appropriate menu
|
|
||||||
switch (employeeType)
|
switch (employeeType)
|
||||||
{
|
{
|
||||||
case Enums::EmployeeType::ADMIN:
|
case Enums::EmployeeType::ADMIN:
|
||||||
@@ -159,4 +189,17 @@ void UserInterface::login()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
m_controller->logout();
|
m_controller->logout();
|
||||||
|
}
|
||||||
|
|
||||||
|
UserInterface::~UserInterface()
|
||||||
|
{
|
||||||
|
delete m_controller;
|
||||||
|
delete m_employeeMenu;
|
||||||
|
delete m_adminMenu;
|
||||||
|
delete m_financeExecutiveMenu;
|
||||||
|
delete m_hrManagerMenu;
|
||||||
|
delete m_itExecutiveMenu;
|
||||||
|
delete m_talentExecutiveMenu;
|
||||||
|
delete m_teamExecutiveMenu;
|
||||||
|
delete m_teamLeadMenu;
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,11 @@
|
|||||||
|
/*
|
||||||
|
* File: UserInterface.h
|
||||||
|
* Description: Declaration of the UserInterface class and related functions.
|
||||||
|
* Author: Trenser
|
||||||
|
* Created: 02-Apr-2026
|
||||||
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <memory>
|
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include "AdminMenu.h"
|
#include "AdminMenu.h"
|
||||||
#include "EmployeeMenu.h"
|
#include "EmployeeMenu.h"
|
||||||
@@ -14,27 +20,28 @@
|
|||||||
class UserInterface
|
class UserInterface
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
std::shared_ptr<ZenvyController> m_controller;
|
ZenvyController* m_controller;
|
||||||
std::shared_ptr<EmployeeMenu> m_employeeMenu;
|
EmployeeMenu* m_employeeMenu;
|
||||||
std::shared_ptr<AdminMenu> m_adminMenu;
|
AdminMenu* m_adminMenu;
|
||||||
std::shared_ptr<FinanceExecutiveMenu> m_financeExecutiveMenu;
|
FinanceExecutiveMenu* m_financeExecutiveMenu;
|
||||||
std::shared_ptr<HRManagerMenu> m_hrManagerMenu;
|
HRManagerMenu* m_hrManagerMenu;
|
||||||
std::shared_ptr<ITExecutiveMenu> m_itExecutiveMenu;
|
ITExecutiveMenu* m_itExecutiveMenu;
|
||||||
std::shared_ptr<TalentExecutiveMenu> m_talentExecutiveMenu;
|
TalentExecutiveMenu* m_talentExecutiveMenu;
|
||||||
std::shared_ptr<TeamExecutiveMenu> m_teamExecutiveMenu;
|
TeamExecutiveMenu* m_teamExecutiveMenu;
|
||||||
std::shared_ptr<TeamLeadMenu> m_teamLeadMenu;
|
TeamLeadMenu* m_teamLeadMenu;
|
||||||
public:
|
public:
|
||||||
UserInterface() : m_controller(std::make_shared<ZenvyController>()),
|
UserInterface() :
|
||||||
m_employeeMenu(std::make_shared<EmployeeMenu>()),
|
m_controller(new ZenvyController()),
|
||||||
m_adminMenu(std::make_shared<AdminMenu>()),
|
m_employeeMenu(new EmployeeMenu()),
|
||||||
m_financeExecutiveMenu(std::make_shared<FinanceExecutiveMenu>()),
|
m_adminMenu(new AdminMenu()),
|
||||||
m_hrManagerMenu(std::make_shared<HRManagerMenu>()),
|
m_financeExecutiveMenu(new FinanceExecutiveMenu()),
|
||||||
m_itExecutiveMenu(std::make_shared<ITExecutiveMenu>()),
|
m_hrManagerMenu(new HRManagerMenu()),
|
||||||
m_talentExecutiveMenu(std::make_shared<TalentExecutiveMenu>()),
|
m_itExecutiveMenu(new ITExecutiveMenu()),
|
||||||
m_teamExecutiveMenu(std::make_shared<TeamExecutiveMenu>()),
|
m_talentExecutiveMenu(new TalentExecutiveMenu()),
|
||||||
m_teamLeadMenu(std::make_shared<TeamLeadMenu>()) {};
|
m_teamExecutiveMenu(new TeamExecutiveMenu()),
|
||||||
void run();
|
m_teamLeadMenu(new TeamLeadMenu()) {};
|
||||||
bool handleOperation(int choice);
|
void run();
|
||||||
void login();
|
bool handleOperation(int choice);
|
||||||
};
|
void login();
|
||||||
|
~UserInterface();
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user