diff --git a/Trenser.FileManager/Trenser.FileManager/FileManager.h b/Trenser.FileManager/Trenser.FileManager/FileManager.h index 1c9f3b2..198934d 100644 --- a/Trenser.FileManager/Trenser.FileManager/FileManager.h +++ b/Trenser.FileManager/Trenser.FileManager/FileManager.h @@ -2,7 +2,7 @@ #include #include "FileIO.h" -template using objects = std::map>; +template using objects = std::map; template class FileManager diff --git a/Trenser.Zenvy/Trenser.Zenvy/Trenser.Zenvy.cpp b/Trenser.Zenvy/Trenser.Zenvy/Trenser.Zenvy.cpp index 9c953a9..f21d31b 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/Trenser.Zenvy.cpp +++ b/Trenser.Zenvy/Trenser.Zenvy/Trenser.Zenvy.cpp @@ -1,3 +1,10 @@ +/* + * File: Trenser.Zenvy.cpp + * Description: Zenvy Main + * Author: Trenser + * Created: 30-Mar-2026 + */ + #include "UserInterface.h" #include "FileManager.h" int main() diff --git a/Trenser.Zenvy/Trenser.Zenvy/controllers/ZenvyController.cpp b/Trenser.Zenvy/Trenser.Zenvy/controllers/ZenvyController.cpp index 9207108..26e3df4 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/controllers/ZenvyController.cpp +++ b/Trenser.Zenvy/Trenser.Zenvy/controllers/ZenvyController.cpp @@ -1,83 +1,245 @@ +/* + * File: ZenvyController.cpp + * Description : Controls data flow between UI and Service Layers. + * Author: Trenser + * Created : 01-Apr-2026 + */ #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) { - return m_authenticationManagementService->login(email, password); + return m_authenticationManagementService->login(email, password); } +/* + * Function: logout + * Description: logs out the currently authenticated employee + * Parameters: + * None + * Returns: + * void - no return value + */ 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) { - m_authenticationManagementService->changePassword(password); + m_authenticationManagementService->changePassword(password); } -//Employee Management -void ZenvyController::createEmployee(Enums::EmployeeType employeeType, Enums::EmployeeDesignation employeeDesignation, const std::string& email, const std::string& name, const std::string& phone) +/* + * Function: createEmployee + * Description: creates a new employee with the given details + * Parameters: + * employeeType - type of employee to be created + * employeeDesignation - designation of the employee + * email - email address of the employee + * name - name of the employee + * phone - phone number of the employee + * Returns: + * void - no return value + */ +void ZenvyController::createEmployee(Enums::EmployeeType employeeType, Enums::EmployeeDesignation employeeDesignation, const std::string& email, const std::string& name, const std::string& phone) const { - m_employeeManagementService->createEmployee(employeeType, employeeDesignation, email, name, phone); + m_employeeManagementService->createEmployee(employeeType, employeeDesignation, email, name, phone); } -bool ZenvyController::deactivateEmployee(const std::string& id) +/* + * Function: deactivateEmployee + * Description: deactivates an employee based on employee ID + * Parameters: + * id - unique employee ID + * Returns: + * bool - true if deactivated successfully, false otherwise + */ +bool ZenvyController::deactivateEmployee(const std::string& id) const { - return m_employeeManagementService->deactivateEmployee(id); + return m_employeeManagementService->deactivateEmployee(id); } +/* + * Function: updateProfile + * Description: updates the profile of the currently authenticated employee + * Parameters: + * name - updated name of the employee + * phone - updated phone number + * Returns: + * void - no return value + */ void ZenvyController::updateProfile(const std::string& name, const std::string& phone) { - m_employeeManagementService->updateProfile(name,phone); + m_employeeManagementService->updateProfile(name, phone); } -std::pair>> ZenvyController::searchEmployee(const std::string& name) +/* + * Function: searchEmployee + * Description: searches employees based on name + * Parameters: + * name - name or partial name of the employee + * Returns: + * Pair of employee type and list of matching employees + */ +std::pair> ZenvyController::searchEmployee(const std::string& name) { - return m_employeeManagementService->searchEmployee(name); + return m_employeeManagementService->searchEmployee(name); } -std::shared_ptr ZenvyController::getCurrentEmployee() +/* + * Function: getCurrentEmployee + * Description: retrieves the currently authenticated employee + * Parameters: + * None + * Returns: + * Pointer to the authenticated employee + */ +const Employee* ZenvyController::getCurrentEmployee() const { - return m_employeeManagementService->getCurrentEmployee(); + return m_employeeManagementService->getCurrentEmployee(); } -bool ZenvyController::updateDesignation(const std::string& id,Enums::EmployeeDesignation designation) +/* + * Function: updateDesignation + * Description: updates the designation of an employee + * Parameters: + * id - unique employee ID + * designation - new designation to be assigned + * Returns: + * bool - true if update is successful, false otherwise + */ +bool ZenvyController::updateDesignation(const std::string& id, Enums::EmployeeDesignation designation) { - return m_employeeManagementService->updateDesignation(id,designation); + return m_employeeManagementService->updateDesignation(id, designation); } -std::vector> ZenvyController::getShorlistedCandidates() +/* + * Function: getShorlistedCandidates + * Description: retrieves the list of shortlisted candidates + * Parameters: + * None + * Returns: + * Vector of shortlisted candidate pointers + */ +std::vector ZenvyController::getShorlistedCandidates() const { - return m_employeeManagementService->getShorlistedCandidates(); + return m_employeeManagementService->getShorlistedCandidates(); } -//Payslip Management +/* + * Function: updateSalary + * Description: updates salary details of an employee + * Parameters: + * employeeId - unique employee ID + * basicSalary - basic salary amount + * houseRentAllowance - HRA amount + * foodAllowance - food allowance amount + * employeePFContribution - employee PF contribution + * employerPFContribution - employer PF contribution + * Returns: + * void - no return value + */ void ZenvyController::updateSalary(const std::string& employeeId, double basicSalary, double houseRentAllowance, double foodAllowance, double employeePFContribution, double employerPFContribution) { - m_payslipManagementService->updateSalary(employeeId, basicSalary, houseRentAllowance, foodAllowance, employeePFContribution, employerPFContribution); + m_payslipManagementService->updateSalary(employeeId, basicSalary, houseRentAllowance, foodAllowance, employeePFContribution, employerPFContribution); } +/* + * Function: generatePayslips + * Description: generates payslips for all eligible employees + * Parameters: + * None + * Returns: + * void - no return value + */ void ZenvyController::generatePayslips() { - m_payslipManagementService->generatePayslips(); + m_payslipManagementService->generatePayslips(); } +/* + * Function: loadStates + * Description: loads persisted application data into memory + * Parameters: + * None + * Returns: + * void - no return value + */ void ZenvyController::loadStates() { - m_employeeManagementService->loadEmployees(); - m_payslipManagementService->loadPayrolls(); - m_payslipManagementService->loadPayslips(); + m_employeeManagementService->loadEmployees(); + m_payslipManagementService->loadPayrolls(); + m_payslipManagementService->loadPayslips(); } +/* + * Function: persistStates + * Description: saves current application data to storage + * Parameters: + * None + * Returns: + * void - no return value + */ void ZenvyController::persistStates() { - m_employeeManagementService->saveEmployees(); - m_payslipManagementService->savePayrolls(); - m_payslipManagementService->savePayslips(); + m_employeeManagementService->saveEmployees(); + m_payslipManagementService->savePayrolls(); + m_payslipManagementService->savePayslips(); } -std::pair, std::shared_ptr> ZenvyController::getPayslipForMonth(const std::string& employeeId, int year, int month) +/* + * Function: getPayslipForMonth + * Description: retrieves payroll and payslip details for a specific month + * Parameters: + * employeeId - unique employee ID + * year - year of the payslip + * month - month of the payslip + * Returns: + * Pair of payroll and payslip pointers + */ +std::pair ZenvyController::getPayslipForMonth(const std::string& employeeId, int year, int month) { - return m_payslipManagementService->getPayslipForMonth(employeeId, year, month); + return m_payslipManagementService->getPayslipForMonth(employeeId, year, month); +} + +/* + * Function: ~ZenvyController + * Description: cleans up dynamically allocated service objects + * Parameters: + * None + * Returns: + * void - no return value + */ +ZenvyController::~ZenvyController() +{ + delete m_authenticationManagementService; + delete m_attendanceManagementService; + delete m_bookingManagementService; + delete m_employeeManagementService; + delete m_leaveManagementService; + delete m_notificationManagementService; + delete m_payslipManagementService; + delete m_talentAcquisitionManagementService; + delete m_teamManagementService; + delete m_ticketManagementService; } \ No newline at end of file diff --git a/Trenser.Zenvy/Trenser.Zenvy/controllers/ZenvyController.h b/Trenser.Zenvy/Trenser.Zenvy/controllers/ZenvyController.h index 261cb67..3f503d4 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/controllers/ZenvyController.h +++ b/Trenser.Zenvy/Trenser.Zenvy/controllers/ZenvyController.h @@ -1,5 +1,11 @@ +/* + * File: ZenvyController.h + * Description : Controls data flow between UI and Service Layers. + * Author: Trenser + * Created : 01-Apr-2026 + */ + #pragma once -#include #include #include "AuthenticationManagementService.h" #include "AttendanceManagementService.h" @@ -16,55 +22,56 @@ class ZenvyController { private: - std::shared_ptr m_authenticationManagementService; - std::shared_ptr m_attendanceManagementService; - std::shared_ptr m_bookingManagementService; - std::shared_ptr m_employeeManagementService; - std::shared_ptr m_leaveManagementService; - std::shared_ptr m_notificationManagementService; - std::shared_ptr m_payslipManagementService; - std::shared_ptr m_talentAcquisitionManagementService; - std::shared_ptr m_teamManagementService; - std::shared_ptr m_ticketManagementService; + AuthenticationManagementService* m_authenticationManagementService; + AttendanceManagementService* m_attendanceManagementService; + BookingManagementService* m_bookingManagementService; + EmployeeManagementService* m_employeeManagementService; + LeaveManagementService* m_leaveManagementService; + NotificationManagementService* m_notificationManagementService; + PayslipManagementService* m_payslipManagementService; + TalentAcquisitionManagementService* m_talentAcquisitionManagementService; + TeamManagementService* m_teamManagementService; + TicketManagementService* m_ticketManagementService; public: - ZenvyController() : - m_authenticationManagementService(std::make_shared()), - m_attendanceManagementService(std::make_shared()), - m_bookingManagementService(std::make_shared()), - m_employeeManagementService(std::make_shared()), - m_leaveManagementService(std::make_shared()), - m_notificationManagementService(std::make_shared()), - m_payslipManagementService(std::make_shared()), - m_talentAcquisitionManagementService(std::make_shared()), - m_teamManagementService(std::make_shared()), - m_ticketManagementService(std::make_shared()) {}; - - //Authentication - AuthenticationDTO login(const std::string& email, const std::string& password); - void logout(); - void changePassword(const std::string&); + ZenvyController() : + m_authenticationManagementService(new AuthenticationManagementService()), + m_attendanceManagementService(new AttendanceManagementService()), + m_bookingManagementService(new BookingManagementService()), + m_employeeManagementService(new EmployeeManagementService()), + m_leaveManagementService(new LeaveManagementService()), + m_notificationManagementService(new NotificationManagementService()), + m_payslipManagementService(new PayslipManagementService()), + m_talentAcquisitionManagementService(new TalentAcquisitionManagementService()), + m_teamManagementService(new TeamManagementService()), + m_ticketManagementService(new TicketManagementService()) {}; + ~ZenvyController(); - //Employee Management - void createEmployee(Enums::EmployeeType, Enums::EmployeeDesignation, const std::string&, const std::string&, const std::string&); - bool deactivateEmployee(const std::string&); - std::shared_ptr getCurrentEmployee(); - void updateProfile(const std::string&,const std::string&); - std::pair>> searchEmployee(const std::string&); - bool updateDesignation(const std::string&,Enums::EmployeeDesignation); - std::vector> getShorlistedCandidates(); + //Authentication + AuthenticationDTO login(const std::string& email, const std::string& password); + void logout(); + void changePassword(const std::string&); - template - Employees getEmployees(Types ...types) - { - return m_employeeManagementService->getEmployees(types...); - } + //Employee Management + void createEmployee(Enums::EmployeeType, Enums::EmployeeDesignation, const std::string&, const std::string&, const std::string&) const; + bool deactivateEmployee(const std::string&) const; + const Employee* getCurrentEmployee() const; + void updateProfile(const std::string&, const std::string&); + std::pair> searchEmployee(const std::string&); + bool updateDesignation(const std::string&, Enums::EmployeeDesignation); + std::vector getShorlistedCandidates() const; - //Payslip management - void updateSalary(const std::string&, double, double, double, double, double); - void generatePayslips(); - std::pair, std::shared_ptr>getPayslipForMonth(const std::string&, int, int); + template + Employees getEmployees(Types ...types) const + { + return m_employeeManagementService->getEmployees(types...); + } - //File Management - void loadStates(); - void persistStates(); -}; + //Payslip management + void updateSalary(const std::string&, double, double, double, double, double); + void generatePayslips(); + std::pairgetPayslipForMonth(const std::string&, int, int); + + //File Management + void loadStates(); + void persistStates(); +}; \ No newline at end of file diff --git a/Trenser.Zenvy/Trenser.Zenvy/datastores/DataStore.cpp b/Trenser.Zenvy/Trenser.Zenvy/datastores/DataStore.cpp index be0897e..fa5610d 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/datastores/DataStore.cpp +++ b/Trenser.Zenvy/Trenser.Zenvy/datastores/DataStore.cpp @@ -1,43 +1,152 @@ +/* + * File: DataStore.cpp + * Description: Central Storage for all the System Data. + * Author: Trenser + * Created: 01-Apr-2026 + */ + #include "DataStore.h" #include "EmployeeManagementService.h" + /* + * Function: getInstance + * Description: provides a singleton instance of the DataStore. + * Parameters: + * None + * Returns: + * DataStore& - reference to the single DataStore object. + */ DataStore& DataStore::getInstance() { - static DataStore dataStore; - return dataStore; + static DataStore 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() { - return m_logs; + return m_logs; } -candidateMap& DataStore::getCandidates() +/* + * Function: getAuthenticatedEmployee + * Description: retrieves the currently authenticated employee. + * Parameters: + * None + * Returns: + * Employee*& - reference to the authenticated employee pointer. + */ +Employee*& DataStore::getAuthenticatedEmployee() { - return m_candidates; + return m_authenticatedEmployee; } -std::shared_ptr& DataStore::getAuthenticatedEmployee() +/* + * Function: setAuthenticatedEmployee + * Description: sets the currently authenticated employee. + * Parameters: + * authenticatedEmployee - pointer to the employee to be set as authenticated. + * Returns: + * void - no return value. + */ +void DataStore::setAuthenticatedEmployee(Employee* authenticatedEmployee) { - return m_authenticatedEmployee; -} - -void DataStore::setAuthenticatedEmployee(std::shared_ptr authenticatedEmployee) -{ - m_authenticatedEmployee = authenticatedEmployee; + m_authenticatedEmployee = authenticatedEmployee; } +/* + * Function: getEmployees + * Description: retrieves the map containing all employees. + * Parameters: + * None + * Returns: + * employeeMap& - reference to the employee map. + */ employeeMap& DataStore::getEmployees() { - return m_employees; + return m_employees; } +/* + * Function: getPayrolls + * Description: retrieves the map containing all payroll records. + * Parameters: + * None + * Returns: + * payrollMap& - reference to the payroll map. + */ payrollMap& DataStore::getPayrolls() { - return m_payrolls; + return m_payrolls; } +/* + * Function: getPayslips + * Description: retrieves the map containing all payslip records. + * Parameters: + * None + * Returns: + * payslipMap& - reference to the payslip map. + */ payslipMap& DataStore::getPayslips() { - return m_payslips; + return m_payslips; } + +/* + * Function: getCandidates + * Description: retrieves the map containing all shortlisted candidates. + * Parameters: + * None + * Returns: + * candidateMap& - reference to the candidate map. + */ +candidateMap& DataStore::getCandidates() +{ + return m_candidates; +} + +/* + * Function: ~DataStore + * Description: releases all dynamically allocated objects stored in the DataStore. + * Parameters: + * None + * Returns: + * void - no return value. + */ +DataStore::~DataStore() +{ + for (auto& pair : m_employees) + { + delete pair.second; + } + m_employees.clear(); + for (auto& pair : m_payrolls) + { + delete pair.second; + } + m_payrolls.clear(); + for (auto& pair : m_payslips) + { + delete pair.second; + } + m_payslips.clear(); + for (auto& pair : m_logs) + { + delete pair.second; + } + m_logs.clear(); + for (auto& pair : m_candidates) + { + delete pair.second; + } + m_candidates.clear(); + m_authenticatedEmployee = nullptr; +} \ No newline at end of file diff --git a/Trenser.Zenvy/Trenser.Zenvy/datastores/DataStore.h b/Trenser.Zenvy/Trenser.Zenvy/datastores/DataStore.h index 972e580..3fe7ed6 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/datastores/DataStore.h +++ b/Trenser.Zenvy/Trenser.Zenvy/datastores/DataStore.h @@ -1,5 +1,11 @@ +/* + * File: DataStore.h + * Description: Central Storage for all the System Data. + * Author: Trenser + * Created: 01-Apr-2026 + */ + #pragma once -#include #include #include "Employee.h" #include "Log.h" @@ -21,33 +27,34 @@ #include "Payroll.h" #include "Payslip.h" -using employeeMap = std::map>; -using payrollMap = std::map>; -using payslipMap = std::map>; -using logMap = std::map>; -using candidateMap = std::map>; +using employeeMap = std::map; +using payrollMap = std::map; +using payslipMap = std::map; +using logMap = std::map; +using candidateMap = std::map; class DataStore { private: - std::shared_ptr m_authenticatedEmployee; + Employee* m_authenticatedEmployee; employeeMap m_employees; payrollMap m_payrolls; payslipMap m_payslips; logMap m_logs; candidateMap m_candidates; - DataStore() = default; + DataStore() : m_authenticatedEmployee(nullptr) {}; public: static DataStore& getInstance(); DataStore(const DataStore&) = delete; DataStore& operator=(const DataStore&) = delete; DataStore(DataStore&&) = delete; DataStore& operator=(DataStore&&) = delete; - employeeMap& getEmployees(); + employeeMap& getEmployees(); payrollMap& getPayrolls(); payslipMap& getPayslips(); logMap& getLogs(); candidateMap& getCandidates(); - std::shared_ptr& getAuthenticatedEmployee(); - void setAuthenticatedEmployee(std::shared_ptr < Employee>); + Employee*& getAuthenticatedEmployee(); + void setAuthenticatedEmployee(Employee*); + ~DataStore(); }; \ No newline at end of file diff --git a/Trenser.Zenvy/Trenser.Zenvy/factories/Factory.h b/Trenser.Zenvy/Trenser.Zenvy/factories/Factory.h index 0c54b81..40eaf40 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/factories/Factory.h +++ b/Trenser.Zenvy/Trenser.Zenvy/factories/Factory.h @@ -1,13 +1,29 @@ +/* + * File: Factory.h + * Description: Provides a generic factory utility to create objects. + * Author: Trenser + * Created: 01-Apr-2026 + */ + #pragma once -#include #include class Factory { public: - template - static std::shared_ptr getObject(Args&&... args) - { - return std::make_shared(std::forward(args)...); - } -}; + + /* + * Function: getObject + * Description: Creates and returns a dynamically allocated object of type T. + * Parameters: + * T - the type of object to be created + * Args - constructor arguments forwarded to T's constructor + * Returns: + * T* - pointer to the newly created object + */ + template + static T* getObject(Args&&... args) + { + return new T(std::forward(args)...); + } +}; \ No newline at end of file diff --git a/Trenser.Zenvy/Trenser.Zenvy/models/Admin.cpp b/Trenser.Zenvy/Trenser.Zenvy/models/Admin.cpp index 0cc2b4c..f63c352 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/models/Admin.cpp +++ b/Trenser.Zenvy/Trenser.Zenvy/models/Admin.cpp @@ -1 +1,7 @@ +/* + * File: Admin.cpp + * Description: Admin model class + * Author: Trenser + * Created: 31-Mar-2026 + */ #include "Admin.h" diff --git a/Trenser.Zenvy/Trenser.Zenvy/models/Admin.h b/Trenser.Zenvy/Trenser.Zenvy/models/Admin.h index c483a61..fdd5daa 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/models/Admin.h +++ b/Trenser.Zenvy/Trenser.Zenvy/models/Admin.h @@ -1,3 +1,9 @@ +/* + * File: Admin.h + * Description: Admin model class + * Author: Trenser + * Created: 31-Mar-2026 + */ #pragma once #include "Employee.h" @@ -9,7 +15,7 @@ public: const std::string& name, const std::string& phone, const std::string& email, - std::shared_ptr payroll + Payroll* payroll ) :Employee(name, phone, email, Enums::EmployeeType::ADMIN, payroll) {}; Admin(const std::string& id, const std::string& name, @@ -29,4 +35,4 @@ public: Enums::EmployeeType::ADMIN, accountStatus) {} ~Admin() = default; -}; +}; \ No newline at end of file diff --git a/Trenser.Zenvy/Trenser.Zenvy/models/Announcement.cpp b/Trenser.Zenvy/Trenser.Zenvy/models/Announcement.cpp index 403222b..ed34094 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/models/Announcement.cpp +++ b/Trenser.Zenvy/Trenser.Zenvy/models/Announcement.cpp @@ -1,3 +1,9 @@ +/* + * File: Announcement.cpp + * Description: The Announcement class defines a simple object for managing announcement details. + * Author: Trenser + * Created: 31-Mar-2026 + */ #include "Announcement.h" int Announcement::m_uid = 0; diff --git a/Trenser.Zenvy/Trenser.Zenvy/models/Announcement.h b/Trenser.Zenvy/Trenser.Zenvy/models/Announcement.h index 5c46514..ed70c16 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/models/Announcement.h +++ b/Trenser.Zenvy/Trenser.Zenvy/models/Announcement.h @@ -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 #include #include "Timestamp.h" diff --git a/Trenser.Zenvy/Trenser.Zenvy/models/Attendance.cpp b/Trenser.Zenvy/Trenser.Zenvy/models/Attendance.cpp index b4a51ef..46a12bc 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/models/Attendance.cpp +++ b/Trenser.Zenvy/Trenser.Zenvy/models/Attendance.cpp @@ -1,3 +1,9 @@ +/* + * 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" int Attendance::m_uid = 0; diff --git a/Trenser.Zenvy/Trenser.Zenvy/models/Attendance.h b/Trenser.Zenvy/Trenser.Zenvy/models/Attendance.h index 013fb0b..0e43f92 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/models/Attendance.h +++ b/Trenser.Zenvy/Trenser.Zenvy/models/Attendance.h @@ -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 #include #include "Timestamp.h" diff --git a/Trenser.Zenvy/Trenser.Zenvy/models/Booking.cpp b/Trenser.Zenvy/Trenser.Zenvy/models/Booking.cpp index 1b0f141..e2c7861 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/models/Booking.cpp +++ b/Trenser.Zenvy/Trenser.Zenvy/models/Booking.cpp @@ -1,3 +1,9 @@ +/* + * 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" int Booking::m_uid = 0; @@ -22,7 +28,7 @@ const std::string& Booking::getEmployeeId() const return m_employeeId; } -std::shared_ptr Booking::getTeam() const +Team* Booking::getTeam() const { return m_team; } @@ -47,7 +53,7 @@ void Booking::setEmployeeId(const std::string& employeeId) m_employeeId = employeeId; } -void Booking::setTeam(std::shared_ptr team) +void Booking::setTeam(Team* team) { m_team = team; } diff --git a/Trenser.Zenvy/Trenser.Zenvy/models/Booking.h b/Trenser.Zenvy/Trenser.Zenvy/models/Booking.h index 2100841..db7dc26 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/models/Booking.h +++ b/Trenser.Zenvy/Trenser.Zenvy/models/Booking.h @@ -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 #include -#include #include "Team.h" #include "Timestamp.h" @@ -12,24 +17,24 @@ private: util::Timestamp m_startTime; util::Timestamp m_endTime; std::string m_employeeId; - std::shared_ptr m_team; + Team* m_team; public: Booking() : m_id("BK" + std::to_string(++m_uid)), m_startTime(), m_endTime(), m_employeeId(""), m_team(nullptr) {} Booking(const util::Timestamp& startTime, const util::Timestamp& endTime, const std::string& employeeId, - std::shared_ptr team) + Team* team) : m_id("BK" + std::to_string(++m_uid)), m_startTime(startTime), m_endTime(endTime), m_employeeId(employeeId), m_team(team) {} const std::string& getBookingId() const; const util::Timestamp& getStartTime() const; const util::Timestamp& getEndTime() const; const std::string& getEmployeeId() const; - std::shared_ptr getTeam() const; + 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); + void setTeam(Team* team); double getDurationInHours() const; double getDurationInMinutes() const; }; \ No newline at end of file diff --git a/Trenser.Zenvy/Trenser.Zenvy/models/Candidate.cpp b/Trenser.Zenvy/Trenser.Zenvy/models/Candidate.cpp index 254aff2..e9bc101 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/models/Candidate.cpp +++ b/Trenser.Zenvy/Trenser.Zenvy/models/Candidate.cpp @@ -1,3 +1,9 @@ +/* + * File: Candidate.cpp + * Description: The Candidate class stores and manages a candidate’s information. + * Author: Trenser + * Created: 31-Mar-2026 + */ #include "Candidate.h" int Candidate::m_uid = 0; diff --git a/Trenser.Zenvy/Trenser.Zenvy/models/Candidate.h b/Trenser.Zenvy/Trenser.Zenvy/models/Candidate.h index 59b9e9b..d5c5f79 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/models/Candidate.h +++ b/Trenser.Zenvy/Trenser.Zenvy/models/Candidate.h @@ -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 #include #include "Enums.h" diff --git a/Trenser.Zenvy/Trenser.Zenvy/models/Employee.cpp b/Trenser.Zenvy/Trenser.Zenvy/models/Employee.cpp index 9f7adf9..7795d56 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/models/Employee.cpp +++ b/Trenser.Zenvy/Trenser.Zenvy/models/Employee.cpp @@ -1,3 +1,9 @@ +/* + * 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 #include "Employee.h" #include "Factory.h" @@ -79,7 +85,7 @@ const std::string& Employee::getEmployeeTeamId() const return m_teamId; } -std::shared_ptr Employee::getPayroll() const +Payroll* Employee::getPayroll() const { return m_payroll; } @@ -99,6 +105,16 @@ const leaveMap& Employee::getEmployeeLeaves() const return m_leaves; } +Enums::EmployeeType Employee::getEmployeeType() const +{ + return m_employeeType; +} + +std::string Employee::getHeaders() +{ + return "EmployeeId,Email,Name,Phone,Password,TeamID,TeamStatus,AccountStatus,EmployeeType"; +} + void Employee::setEmployeeId(const std::string& id) { m_id = id; @@ -134,12 +150,20 @@ void Employee::setEmployeeTeamId(const std::string& teamId) m_teamId = teamId; } -void Employee::setEmployeePayroll(std::shared_ptr payroll) +void Employee::setEmployeePayroll(Payroll* payroll) { m_payroll = payroll; } -void Employee::addPayslip(std::shared_ptr payslip) +/* +* Function: addPayslip +* Description : Adds a payslip to the employee's payslip records +* Parameters : + payslip - Pointer to the Payslip object to be added +* Returns : + void + */ +void Employee::addPayslip(Payslip* payslip) { if (payslip) { @@ -147,7 +171,15 @@ void Employee::addPayslip(std::shared_ptr payslip) } } -void Employee::addAttendance(std::shared_ptr attendance) +/* + * Function: addAttendance + * Description: Adds an attendance record to the employee's attendance history + * Parameters: + * attendance - Pointer to the Attendance object containing login information + * Returns: + * void + */ +void Employee::addAttendance(Attendance* attendance) { if (attendance) { @@ -155,7 +187,15 @@ void Employee::addAttendance(std::shared_ptr attendance) } } -void Employee::addLeave(std::shared_ptr leave) +/* + * Function: addLeave + * Description: Adds a leave record to the employee's leave history + * Parameters: + * leave - Pointer to the Leave object to be added + * Returns: + * void + */ +void Employee::addLeave(Leave* leave) { if (leave) { @@ -163,11 +203,14 @@ void Employee::addLeave(std::shared_ptr leave) } } -Enums::EmployeeType Employee::getEmployeeType() const -{ - return m_employeeType; -} - +/* + * Function: serialize + * Description: Serializes the employee object's core details into a comma-separated string + * Parameters: + None + * Returns: + A string containing serialized employee data in CSV format + */ std::string Employee::serialize() const { std::ostringstream serializedEmployee; @@ -183,7 +226,15 @@ std::string Employee::serialize() const return serializedEmployee.str(); } -std::shared_ptr Employee::deserialize(const std::string& record) +/* + * Function: deserialize + * Description: Creates and returns an Employee object from a serialized comma-separated record string + * Parameters: + record - A string containing serialized employee data in CSV format + * Returns: + Pointer to a newly created Employee object based on the employee type + */ +Employee* Employee::deserialize(const std::string& record) { std::string id, name, phone, password, email; std::string teamId, teamStatusString, accountStatusString, employeeTypeString; @@ -273,9 +324,4 @@ std::shared_ptr Employee::deserialize(const std::string& record) default: return nullptr; } -} - -std::string Employee::getHeaders() -{ - return "EmployeeId,Email,Name,Phone,Password,TeamID,TeamStatus,AccountStatus,EmployeeType"; -} +} \ No newline at end of file diff --git a/Trenser.Zenvy/Trenser.Zenvy/models/Employee.h b/Trenser.Zenvy/Trenser.Zenvy/models/Employee.h index 46657c1..214e89c 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/models/Employee.h +++ b/Trenser.Zenvy/Trenser.Zenvy/models/Employee.h @@ -1,6 +1,11 @@ +/* + * 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 #include -#include #include #include "Payslip.h" #include "Attendance.h" @@ -8,9 +13,9 @@ #include "Payroll.h" #include "Enums.h" #include "ApplicationConfig.h" -using payslipMap = std::map>; -using attendanceMap = std::map>>; -using leaveMap = std::map>; +using payslipMap = std::map; +using attendanceMap = std::map>; +using leaveMap = std::map; class Employee { @@ -24,7 +29,7 @@ protected: Enums::AccountStatus m_accountStatus; Enums::TeamStatus m_teamStatus; std::string m_teamId; - std::shared_ptr m_payroll; + Payroll* m_payroll; payslipMap m_payslips; attendanceMap m_attendances; leaveMap m_leaves; @@ -39,12 +44,13 @@ public: m_accountStatus(Enums::AccountStatus::ACTIVE), m_teamStatus(Enums::TeamStatus::NOT_IN_TEAM), m_teamId(""), + m_payroll(nullptr), m_employeeType(Enums::EmployeeType::GENERAL) {} Employee(const std::string& name, const std::string& phone, const std::string& email, Enums::EmployeeType employeeType, - std::shared_ptr payroll) + Payroll* payroll) : m_id("EMP" + std::to_string(++m_uid)), m_password(Config::Authentication::DEFAULT_PASSWORD), m_name(name), @@ -72,7 +78,7 @@ public: Enums::AccountStatus getEmployeeAccountStatus() const; Enums::TeamStatus getEmployeeTeamStatus() const; const std::string& getEmployeeTeamId() const; - std::shared_ptr getPayroll() const; + Payroll* getPayroll() const; const payslipMap& getEmployeePayslips() const; const attendanceMap& getEmployeeAttendances() const; const leaveMap& getEmployeeLeaves() const; @@ -83,13 +89,13 @@ public: void setEmployeeAccountStatus(Enums::AccountStatus status); void setEmployeeTeamStatus(Enums::TeamStatus status); void setEmployeeTeamId(const std::string& teamId); - void setEmployeePayroll(std::shared_ptr payroll); - void addPayslip(std::shared_ptr payslip); - void addAttendance(std::shared_ptr attendance); - void addLeave(std::shared_ptr leave); + void setEmployeePayroll(Payroll* payroll); + void addPayslip(Payslip* payslip); + void addAttendance(Attendance* attendance); + void addLeave(Leave* leave); Enums::EmployeeType getEmployeeType() const; virtual std::string serialize() const; - static std::shared_ptr deserialize(const std::string&); + static Employee* deserialize(const std::string&); static std::string getHeaders(); virtual ~Employee() = default; }; \ No newline at end of file diff --git a/Trenser.Zenvy/Trenser.Zenvy/models/FAQ.cpp b/Trenser.Zenvy/Trenser.Zenvy/models/FAQ.cpp index 63a403f..4badf93 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/models/FAQ.cpp +++ b/Trenser.Zenvy/Trenser.Zenvy/models/FAQ.cpp @@ -1 +1,7 @@ -#include "Faq.h" +/* + * File: Faq.h + * Description: Faq model class. + * Author: Trenser + * Created: 02-Apr-2026 + */ +#include "Faq.h" \ No newline at end of file diff --git a/Trenser.Zenvy/Trenser.Zenvy/models/FAQ.h b/Trenser.Zenvy/Trenser.Zenvy/models/FAQ.h index b90edff..a2ba8bf 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/models/FAQ.h +++ b/Trenser.Zenvy/Trenser.Zenvy/models/FAQ.h @@ -1,6 +1,11 @@ +/* + * File: Faq.h + * Description: Faq model class. + * Author: Trenser + * Created: 02-Apr-2026 + */ #pragma once class Faq { -}; - +}; \ No newline at end of file diff --git a/Trenser.Zenvy/Trenser.Zenvy/models/FinanceExecutive.cpp b/Trenser.Zenvy/Trenser.Zenvy/models/FinanceExecutive.cpp index ec96663..93d3b6c 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/models/FinanceExecutive.cpp +++ b/Trenser.Zenvy/Trenser.Zenvy/models/FinanceExecutive.cpp @@ -1 +1,7 @@ +/* + * File: FinanceExecutive.h + * Description: FinanceExecutive model class. + * Author: Trenser + * Created: 31-Mar-2026 + */ #include "FinanceExecutive.h" \ No newline at end of file diff --git a/Trenser.Zenvy/Trenser.Zenvy/models/FinanceExecutive.h b/Trenser.Zenvy/Trenser.Zenvy/models/FinanceExecutive.h index e877627..1a58dfe 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/models/FinanceExecutive.h +++ b/Trenser.Zenvy/Trenser.Zenvy/models/FinanceExecutive.h @@ -1,3 +1,9 @@ +/* + * File: FinanceExecutive.h + * Description: FinanceExecutive model class. + * Author: Trenser + * Created: 31-Mar-2026 + */ #pragma once #include "Employee.h" @@ -9,7 +15,7 @@ public: const std::string& name, const std::string& phone, const std::string& email, - std::shared_ptr payroll + Payroll* payroll ) :Employee(name, phone, email, Enums::EmployeeType::FINANCE, payroll) {}; FinanceExecutive(const std::string& id, const std::string& name, @@ -29,5 +35,4 @@ public: Enums::EmployeeType::FINANCE, accountStatus) {} ~FinanceExecutive() = default; -}; - +}; \ No newline at end of file diff --git a/Trenser.Zenvy/Trenser.Zenvy/models/GeneralEmployee.cpp b/Trenser.Zenvy/Trenser.Zenvy/models/GeneralEmployee.cpp index 00a7085..fcf784c 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/models/GeneralEmployee.cpp +++ b/Trenser.Zenvy/Trenser.Zenvy/models/GeneralEmployee.cpp @@ -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 + */ #include #include "GeneralEmployee.h" #include "Factory.h" @@ -7,11 +13,24 @@ Enums::EmployeeDesignation GeneralEmployee::getDesignation() const return m_designation; } +std::string GeneralEmployee::getHeaders() +{ + return "EmployeeId,Email,Name,Phone,Password,TeamID,TeamStatus,AccountStatus,EmployeeType,EmployeeDesignation"; +} + void GeneralEmployee::setDesignation(Enums::EmployeeDesignation designation) { m_designation = designation; } +/* + * Function: serialize + * Description: Serializes the general employee's details, including designation, into a comma-separated string + * Parameters: + None + * Returns: + A string containing serialized general employee data in CSV format + */ std::string GeneralEmployee::serialize() const { std::ostringstream serializedEmployee; @@ -28,7 +47,15 @@ std::string GeneralEmployee::serialize() const return serializedEmployee.str(); } -std::shared_ptr GeneralEmployee::deserialize(const std::string& record) +/* + * Function: deserialize + * Description: Creates and returns a GeneralEmployee object from a serialized comma-separated record string + * Parameters: + record - A string containing serialized general employee data in CSV format + * Returns: + Pointer to a newly created GeneralEmployee object + */ +GeneralEmployee* GeneralEmployee::deserialize(const std::string& record) { std::string id, name, phone, password, email; std::string teamId, teamStatusString, accountStatusString, employeeTypeString, employeeDesignationString; @@ -58,9 +85,4 @@ std::shared_ptr GeneralEmployee::deserialize(const std::string& employeeDesignation, accountStatus ); -} - -std::string GeneralEmployee::getHeaders() -{ - return "EmployeeId,Email,Name,Phone,Password,TeamID,TeamStatus,AccountStatus,EmployeeType,EmployeeDesignation"; } \ No newline at end of file diff --git a/Trenser.Zenvy/Trenser.Zenvy/models/GeneralEmployee.h b/Trenser.Zenvy/Trenser.Zenvy/models/GeneralEmployee.h index 61b1a06..885349c 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/models/GeneralEmployee.h +++ b/Trenser.Zenvy/Trenser.Zenvy/models/GeneralEmployee.h @@ -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 #include "Employee.h" #include "Enums.h" @@ -12,7 +18,7 @@ public: GeneralEmployee(const std::string& name, const std::string& phone, const std::string& email, - std::shared_ptr payroll, + Payroll* payroll, Enums::EmployeeDesignation designation) : Employee(name, phone, @@ -42,7 +48,7 @@ public: Enums::EmployeeDesignation getDesignation() const; void setDesignation(Enums::EmployeeDesignation designation); std::string serialize() const override; - static std::shared_ptr deserialize(const std::string&); + static GeneralEmployee* deserialize(const std::string&); static std::string getHeaders(); ~GeneralEmployee() = default; }; \ No newline at end of file diff --git a/Trenser.Zenvy/Trenser.Zenvy/models/HRManager.cpp b/Trenser.Zenvy/Trenser.Zenvy/models/HRManager.cpp index 4b7ee33..3a3733b 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/models/HRManager.cpp +++ b/Trenser.Zenvy/Trenser.Zenvy/models/HRManager.cpp @@ -1 +1,7 @@ -#include "HRManager.h" +/* + * File: HRManager.cpp + * Description: HRManager model class. + * Author: Trenser + * Created: 31-Mar-2026 + */ +#include "HRManager.h" \ No newline at end of file diff --git a/Trenser.Zenvy/Trenser.Zenvy/models/HRManager.h b/Trenser.Zenvy/Trenser.Zenvy/models/HRManager.h index 43f572c..6a08f03 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/models/HRManager.h +++ b/Trenser.Zenvy/Trenser.Zenvy/models/HRManager.h @@ -1,3 +1,9 @@ +/* + * File: HRManager.h + * Description: HRManager model class. + * Author: Trenser + * Created: 31-Mar-2026 + */ #pragma once #include "Employee.h" @@ -9,7 +15,7 @@ public: const std::string& name, const std::string& phone, const std::string& email, - std::shared_ptr payroll + Payroll* payroll ) :Employee(name, phone, email, Enums::EmployeeType::HR, payroll) {}; HRManager(const std::string& id, const std::string& name, @@ -29,5 +35,4 @@ public: Enums::EmployeeType::HR, accountStatus) {} ~HRManager() = default; -}; - +}; \ No newline at end of file diff --git a/Trenser.Zenvy/Trenser.Zenvy/models/ITExecutive.cpp b/Trenser.Zenvy/Trenser.Zenvy/models/ITExecutive.cpp index 700fcd9..7beaf7d 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/models/ITExecutive.cpp +++ b/Trenser.Zenvy/Trenser.Zenvy/models/ITExecutive.cpp @@ -1 +1,7 @@ +/* + * File: ITExecutive.cpp + * Description: ITExecutive model class. + * Author: Trenser + * Created: 31-Mar-2026 + */ #include "ITExecutive.h" \ No newline at end of file diff --git a/Trenser.Zenvy/Trenser.Zenvy/models/ITExecutive.h b/Trenser.Zenvy/Trenser.Zenvy/models/ITExecutive.h index a69f673..ab807e8 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/models/ITExecutive.h +++ b/Trenser.Zenvy/Trenser.Zenvy/models/ITExecutive.h @@ -1,3 +1,9 @@ +/* + * File: ITExecutive.h + * Description: ITExecutive model class. + * Author: Trenser + * Created: 31-Mar-2026 + */ #pragma once #include "Employee.h" @@ -9,7 +15,7 @@ public: const std::string& name, const std::string& phone, const std::string& email, - std::shared_ptr payroll + Payroll* payroll ) :Employee(name, phone, email, Enums::EmployeeType::IT, payroll) {}; ITExecutive(const std::string& id, const std::string& name, @@ -29,5 +35,4 @@ public: Enums::EmployeeType::IT, accountStatus) {} ~ITExecutive() = default; -}; - +}; \ No newline at end of file diff --git a/Trenser.Zenvy/Trenser.Zenvy/models/JobListing.cpp b/Trenser.Zenvy/Trenser.Zenvy/models/JobListing.cpp index c2152cb..ecb91d4 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/models/JobListing.cpp +++ b/Trenser.Zenvy/Trenser.Zenvy/models/JobListing.cpp @@ -1,3 +1,9 @@ +/* +File: JobListing.cpp +* Description : Represents a job opening along with its details and applied candidates. +* Author : Trenser +* Created : 01-Apr-2026 +*/ #include "JobListing.h" int JobListing::m_uid = 0; diff --git a/Trenser.Zenvy/Trenser.Zenvy/models/JobListing.h b/Trenser.Zenvy/Trenser.Zenvy/models/JobListing.h index 61af21d..ddbf58d 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/models/JobListing.h +++ b/Trenser.Zenvy/Trenser.Zenvy/models/JobListing.h @@ -1,10 +1,15 @@ +/* +File: JobListing.h +* Description : Represents a job opening along with its details and applied candidates. +* Author : Trenser +* Created : 01-Apr-2026 +*/ #pragma once #include #include -#include #include "Candidate.h" #include "Enums.h" -using candidateMap = std::map>; +using candidateMap = std::map; class JobListing { diff --git a/Trenser.Zenvy/Trenser.Zenvy/models/Leave.cpp b/Trenser.Zenvy/Trenser.Zenvy/models/Leave.cpp index bbb0ff2..c3f8a2d 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/models/Leave.cpp +++ b/Trenser.Zenvy/Trenser.Zenvy/models/Leave.cpp @@ -1,3 +1,9 @@ +/* +File: Leave.cpp +* Description : Stores information related to an employee’s leave application. +* Author : Trenser +* Created : 31-Mar-2026 +*/ #include "Leave.h" int Leave::m_uid = 0; @@ -22,21 +28,6 @@ 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; @@ -62,28 +53,7 @@ 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; \ No newline at end of file +} \ No newline at end of file diff --git a/Trenser.Zenvy/Trenser.Zenvy/models/Leave.h b/Trenser.Zenvy/Trenser.Zenvy/models/Leave.h index 4c50bf1..3bd731f 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/models/Leave.h +++ b/Trenser.Zenvy/Trenser.Zenvy/models/Leave.h @@ -1,3 +1,9 @@ +/* +File: Leave.h +* Description : Stores information related to an employee’s leave application. +* Author : Trenser +* Created : 31-Mar-2026 +*/ #pragma once #include #include "Enums.h" @@ -11,9 +17,6 @@ private: 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("LV" + std::to_string(++m_uid)), m_employeeId(""), m_timestamp(), m_reason(""), m_leaveType(Enums::LeaveType::GENERAL) {} @@ -26,16 +29,10 @@ public: 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); }; \ No newline at end of file diff --git a/Trenser.Zenvy/Trenser.Zenvy/models/Log.cpp b/Trenser.Zenvy/Trenser.Zenvy/models/Log.cpp index 890cfc5..579b908 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/models/Log.cpp +++ b/Trenser.Zenvy/Trenser.Zenvy/models/Log.cpp @@ -1,3 +1,9 @@ +/* +File: Log.cpp +* Description : Represents a log entry containing a timestamp and an associated message. +* Author : Trenser +* Created : 01-Apr-2026 +*/ #include "Log.h" const util::Timestamp& Log::getTimestamp() const diff --git a/Trenser.Zenvy/Trenser.Zenvy/models/Log.h b/Trenser.Zenvy/Trenser.Zenvy/models/Log.h index f2350b2..cfb830d 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/models/Log.h +++ b/Trenser.Zenvy/Trenser.Zenvy/models/Log.h @@ -1,3 +1,9 @@ +/* +File: Log.h +* Description : Represents a log entry containing a timestamp and an associated message. +* Author : Trenser +* Created : 01-Apr-2026 +*/ #pragma once #include #include "Timestamp.h" diff --git a/Trenser.Zenvy/Trenser.Zenvy/models/Notification.cpp b/Trenser.Zenvy/Trenser.Zenvy/models/Notification.cpp index 2f63026..3da5d9b 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/models/Notification.cpp +++ b/Trenser.Zenvy/Trenser.Zenvy/models/Notification.cpp @@ -1,3 +1,9 @@ +/* +File: Notification.cpp +* Description : Represents an employee notification with message and status details. +* Author : Trenser +* Created : 31-Mar-2026 +*/ #include "Notification.h" int Notification::m_uid = 0; diff --git a/Trenser.Zenvy/Trenser.Zenvy/models/Notification.h b/Trenser.Zenvy/Trenser.Zenvy/models/Notification.h index 194183d..196078a 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/models/Notification.h +++ b/Trenser.Zenvy/Trenser.Zenvy/models/Notification.h @@ -1,3 +1,9 @@ +/* +File: Notification.h +* Description : Represents an employee notification with message and status details. +* Author : Trenser +* Created : 31-Mar-2026 +*/ #pragma once #include #include "Enums.h" diff --git a/Trenser.Zenvy/Trenser.Zenvy/models/Payroll.cpp b/Trenser.Zenvy/Trenser.Zenvy/models/Payroll.cpp index b85153b..ba958ce 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/models/Payroll.cpp +++ b/Trenser.Zenvy/Trenser.Zenvy/models/Payroll.cpp @@ -1,5 +1,10 @@ +/* +File: Payroll.cpp +* Description : Stores payroll and salary breakdown details for an employee. +* Author : Trenser +* Created : 31-Mar-2026 +*/ #include -#include #include "Payroll.h" #include "StringHelper.h" #include "Factory.h" @@ -68,6 +73,11 @@ double Payroll::getEmployerPFContribution() const return m_employerPFContribution; } +std::string Payroll::getHeaders() +{ + return "PayrollId,EmployeeId,BasicSalary,HouseRentAllowance,FoodAllowance,EmployeePFContribution,EmployerPFContribution"; +} + void Payroll::setBasicSalary(double basicSalary) { m_basicSalary = basicSalary; @@ -93,6 +103,14 @@ void Payroll::setEmployerPFContribution(double value) m_employerPFContribution = value; } +/* +Function: serialize +Description: Converts the payroll object into a comma-separated string. +Parameters: + None +Returns: + A serialized string representation of the payroll. +*/ std::string Payroll::serialize() const { std::ostringstream serializedPayroll; @@ -106,7 +124,15 @@ std::string Payroll::serialize() const return serializedPayroll.str(); } -std::shared_ptr Payroll::deserialize(const std::string& record) +/* +Function: deserialize +Description: Creates a Payroll object from a serialized comma-separated string. +Parameters: + record - Serialized payroll data. +Returns: + Pointer to a Payroll object. +*/ +Payroll* Payroll::deserialize(const std::string& record) { std::string id, employeeId; std::string basicSalaryString, houseRentAllowanceString, foodAllowanceString, employeePFString, employerPFString; @@ -139,9 +165,4 @@ std::shared_ptr Payroll::deserialize(const std::string& record) { throw std::runtime_error("Failed to deserialize Payroll object"); } -} - -std::string Payroll::getHeaders() -{ - return "PayrollId,EmployeeId,BasicSalary,HouseRentAllowance,FoodAllowance,EmployeePFContribution,EmployerPFContribution"; -} +} \ No newline at end of file diff --git a/Trenser.Zenvy/Trenser.Zenvy/models/Payroll.h b/Trenser.Zenvy/Trenser.Zenvy/models/Payroll.h index 460c596..7b4699b 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/models/Payroll.h +++ b/Trenser.Zenvy/Trenser.Zenvy/models/Payroll.h @@ -1,6 +1,11 @@ +/* +File: Payroll.h +* Description : Stores payroll and salary breakdown details for an employee. +* Author : Trenser +* Created : 31-Mar-2026 +*/ #pragma once #include -#include #include "Timestamp.h" class Payroll @@ -49,12 +54,12 @@ public: double getFoodAllowance() const; double getEmployeePFContribution() const; double getEmployerPFContribution() const; + static std::string getHeaders(); void setBasicSalary(double); void setHouseRentAllowance(double); void setFoodAllowance(double); void setEmployeePFContribution(double); void setEmployerPFContribution(double); std::string serialize() const; - static std::shared_ptr deserialize(const std::string&); - static std::string getHeaders(); + static Payroll* deserialize(const std::string&); }; \ No newline at end of file diff --git a/Trenser.Zenvy/Trenser.Zenvy/models/Payslip.cpp b/Trenser.Zenvy/Trenser.Zenvy/models/Payslip.cpp index 91e0b38..1f4f705 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/models/Payslip.cpp +++ b/Trenser.Zenvy/Trenser.Zenvy/models/Payslip.cpp @@ -1,3 +1,9 @@ +/* +File: Payslip.cpp +* Description : Models a payslip entity that stores salary information. +* Author : Trenser +* Created : 31-Mar-2026 +*/ #include #include "Payslip.h" #include "StringHelper.h" @@ -51,6 +57,19 @@ const std::string& Payslip::getEmployeeId() const return m_employeeId; } +std::string Payslip::getHeaders() +{ + return "PayslipId,EmployeeId,Salary,Timestamp"; +} + +/* +Function: serialize +Description: Converts the payslip object into a comma-separated string. +Parameters: + None +Returns: + A serialized string representation of the payslip. +*/ std::string Payslip::serialize() const { std::ostringstream serializedPayslip; @@ -61,7 +80,15 @@ std::string Payslip::serialize() const return serializedPayslip.str(); } -std::shared_ptr Payslip::deserialize(const std::string& record) +/* +Function: deserialize +Description: Creates a Payslip object from a serialized comma-separated string. +Parameters: + record - Serialized payslip data. +Returns: + Pointer to a Payslip object. +*/ +Payslip* Payslip::deserialize(const std::string& record) { std::string id, employeeId, timestampString; std::string salaryString; @@ -86,9 +113,4 @@ std::shared_ptr Payslip::deserialize(const std::string& record) { throw std::runtime_error("Failed to deserialize Payslip object"); } -} - -std::string Payslip::getHeaders() -{ - return "PayslipId,EmployeeId,Salary,Timestamp"; -} +} \ No newline at end of file diff --git a/Trenser.Zenvy/Trenser.Zenvy/models/Payslip.h b/Trenser.Zenvy/Trenser.Zenvy/models/Payslip.h index b8b971d..108b9c5 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/models/Payslip.h +++ b/Trenser.Zenvy/Trenser.Zenvy/models/Payslip.h @@ -1,5 +1,10 @@ +/* +File: Payslip.h +* Description : Models a payslip entity that stores salary information. +* Author : Trenser +* Created : 31-Mar-2026 +*/ #pragma once -#include #include #include "Timestamp.h" @@ -20,11 +25,11 @@ public: util::Timestamp timestamp); const std::string& getId() const; double getSalary() const; + static std::string getHeaders(); void setPayslipId(const std::string& id); void setSalary(double salary); const util::Timestamp& getTimestamp() const; const std::string& getEmployeeId() const; std::string serialize() const; - static std::shared_ptr deserialize(const std::string&); - static std::string getHeaders(); + static Payslip* deserialize(const std::string&); }; \ No newline at end of file diff --git a/Trenser.Zenvy/Trenser.Zenvy/models/Room.cpp b/Trenser.Zenvy/Trenser.Zenvy/models/Room.cpp index b5c4d50..6c1df34 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/models/Room.cpp +++ b/Trenser.Zenvy/Trenser.Zenvy/models/Room.cpp @@ -1,3 +1,9 @@ +/* +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" int Room::m_uid = 0; @@ -27,7 +33,15 @@ void Room::setRoomName(const std::string& name) m_name = name; } -void Room::addBooking(std::shared_ptr booking) +/* +Function: addBooking +Description: Adds a valid booking to the room’s booking list using the booking ID as the key. +Parameters: + booking - A pointer to a Booking object to be added to the room. +Returns: + void +*/ +void Room::addBooking(Booking* booking) { if (booking) { diff --git a/Trenser.Zenvy/Trenser.Zenvy/models/Room.h b/Trenser.Zenvy/Trenser.Zenvy/models/Room.h index 1dfe66a..63a52a8 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/models/Room.h +++ b/Trenser.Zenvy/Trenser.Zenvy/models/Room.h @@ -1,9 +1,14 @@ +/* +File: Room.h +* Description : Models a room entity that maintains room details and manages its bookings. +* Author : Trenser +* Created : 31-Mar-2026 +*/ #pragma once #include #include -#include #include "Booking.h" -using bookingMap = std::map>; +using bookingMap = std::map; class Room { @@ -20,5 +25,5 @@ public: const bookingMap& getBookings() const; void setRoomId(const std::string& id); void setRoomName(const std::string& name); - void addBooking(std::shared_ptr booking); + void addBooking(Booking* booking); }; \ No newline at end of file diff --git a/Trenser.Zenvy/Trenser.Zenvy/models/TalentExecutive.cpp b/Trenser.Zenvy/Trenser.Zenvy/models/TalentExecutive.cpp index de7213f..7023cd6 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/models/TalentExecutive.cpp +++ b/Trenser.Zenvy/Trenser.Zenvy/models/TalentExecutive.cpp @@ -1 +1,7 @@ +/* +File: TalentExecutive.cpp +* Description : Represents information related to a talent executive in the system. +* Author : Trenser +* Created : 31-Mar-2026 +*/ #include "TalentExecutive.h" \ No newline at end of file diff --git a/Trenser.Zenvy/Trenser.Zenvy/models/TalentExecutive.h b/Trenser.Zenvy/Trenser.Zenvy/models/TalentExecutive.h index 90bc664..9ddde43 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/models/TalentExecutive.h +++ b/Trenser.Zenvy/Trenser.Zenvy/models/TalentExecutive.h @@ -1,3 +1,9 @@ +/* +File: TalentExecutive.h +* Description : Represents information related to a talent executive in the system. +* Author : Trenser +* Created : 31-Mar-2026 +*/ #pragma once #include "Employee.h" @@ -9,7 +15,7 @@ public: const std::string& name, const std::string& phone, const std::string& email, - std::shared_ptr payroll + Payroll* payroll ) :Employee(name, phone, email, Enums::EmployeeType::TALENT_ACQUISITION, payroll) {}; TalentExecutive(const std::string& id, const std::string& name, @@ -30,5 +36,4 @@ public: accountStatus) { } ~TalentExecutive() = default; -}; - +}; \ No newline at end of file diff --git a/Trenser.Zenvy/Trenser.Zenvy/models/Team.cpp b/Trenser.Zenvy/Trenser.Zenvy/models/Team.cpp index abf8a23..5168acb 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/models/Team.cpp +++ b/Trenser.Zenvy/Trenser.Zenvy/models/Team.cpp @@ -1,3 +1,9 @@ +/* +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" int Team::m_uid = 0; @@ -12,7 +18,7 @@ const std::string& Team::getTeamName() const return m_name; } -std::shared_ptr Team::getTeamLead() const +Employee* Team::getTeamLead() const { return m_lead; } @@ -37,7 +43,7 @@ void Team::setTeamName(const std::string& name) m_name = name; } -void Team::setTeamLead(std::shared_ptr lead) +void Team::setTeamLead(Employee* lead) { m_lead = lead; } diff --git a/Trenser.Zenvy/Trenser.Zenvy/models/Team.h b/Trenser.Zenvy/Trenser.Zenvy/models/Team.h index fca1698..7afcaae 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/models/Team.h +++ b/Trenser.Zenvy/Trenser.Zenvy/models/Team.h @@ -1,9 +1,14 @@ +/* +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 #include #include -#include #include "Employee.h" -using employeeMap = std::map>; +using employeeMap = std::map; class Team { @@ -11,25 +16,25 @@ private: static int m_uid; std::string m_id; std::string m_name; - std::shared_ptr m_lead; + Employee* m_lead; employeeMap m_employees; int m_maximumNumberOfEmployees; public: Team() : m_id("TM" + std::to_string(++m_uid)), m_name(""), m_lead(nullptr), m_maximumNumberOfEmployees(0) {} Team( const std::string& name, - std::shared_ptr lead, + Employee* lead, int maximumNumberOfEmployees) : m_id("TM" + std::to_string(++m_uid)), m_name(name), m_lead(lead), m_maximumNumberOfEmployees(maximumNumberOfEmployees) { } const std::string& getTeamId() const; const std::string& getTeamName() const; - std::shared_ptr getTeamLead() const; + 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 lead); + void setTeamLead(Employee* lead); void setEmployeesInTeam(const employeeMap& employees); void setMaximumNumberOfEmployeesInTeam(int maximumNumberOfEmployees); }; \ No newline at end of file diff --git a/Trenser.Zenvy/Trenser.Zenvy/models/TeamExecutive.cpp b/Trenser.Zenvy/Trenser.Zenvy/models/TeamExecutive.cpp index df14a3f..91d1691 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/models/TeamExecutive.cpp +++ b/Trenser.Zenvy/Trenser.Zenvy/models/TeamExecutive.cpp @@ -1 +1,7 @@ +/* +File: TeamExecutive.cpp +* Description : Represents information related to a team executive within the system. +* Author : Trenser +* Created : 31-Mar-2026 +*/ #include "TeamExecutive.h" \ No newline at end of file diff --git a/Trenser.Zenvy/Trenser.Zenvy/models/TeamExecutive.h b/Trenser.Zenvy/Trenser.Zenvy/models/TeamExecutive.h index 3f79197..b550be3 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/models/TeamExecutive.h +++ b/Trenser.Zenvy/Trenser.Zenvy/models/TeamExecutive.h @@ -1,3 +1,9 @@ +/* +File: TeamExecutive.h +* Description : Represents information related to a team executive within the system. +* Author : Trenser +* Created : 31-Mar-2026 +*/ #pragma once #include "Employee.h" @@ -9,7 +15,7 @@ public: const std::string& name, const std::string& phone, const std::string& email, - std::shared_ptr payroll + Payroll* payroll ) :Employee(name, phone, email, Enums::EmployeeType::TEAM, payroll) {}; TeamExecutive(const std::string& id, const std::string& name, @@ -29,5 +35,4 @@ public: Enums::EmployeeType::TEAM, accountStatus) {} ~TeamExecutive() = default; -}; - +}; \ No newline at end of file diff --git a/Trenser.Zenvy/Trenser.Zenvy/models/Ticket.cpp b/Trenser.Zenvy/Trenser.Zenvy/models/Ticket.cpp index 84fd042..a07174e 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/models/Ticket.cpp +++ b/Trenser.Zenvy/Trenser.Zenvy/models/Ticket.cpp @@ -1,3 +1,9 @@ +/* +File: Ticket.cpp +* Description : Represents a support ticket with its associated details and status. +* Author : Trenser +* Created : 31-Mar-2026 +*/ #include "Ticket.h" int Ticket::m_uid = 0; diff --git a/Trenser.Zenvy/Trenser.Zenvy/models/Ticket.h b/Trenser.Zenvy/Trenser.Zenvy/models/Ticket.h index 56d39af..ba5f25e 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/models/Ticket.h +++ b/Trenser.Zenvy/Trenser.Zenvy/models/Ticket.h @@ -1,3 +1,9 @@ +/* +File: Ticket.h +* Description : Represents a support ticket with its associated details and status. +* Author : Trenser +* Created : 31-Mar-2026 +*/ #pragma once #include #include "Enums.h" diff --git a/Trenser.Zenvy/Trenser.Zenvy/services/ApplicationConfig.cpp b/Trenser.Zenvy/Trenser.Zenvy/services/ApplicationConfig.cpp index cb68b98..e612cbc 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/services/ApplicationConfig.cpp +++ b/Trenser.Zenvy/Trenser.Zenvy/services/ApplicationConfig.cpp @@ -1 +1,7 @@ +/* + * File: ApplicationConfig.cpp + * Description: Global Application Config + * Author: Trenser + * Created: 06-Apr-2026 + */ #include "ApplicationConfig.h" diff --git a/Trenser.Zenvy/Trenser.Zenvy/services/ApplicationConfig.h b/Trenser.Zenvy/Trenser.Zenvy/services/ApplicationConfig.h index 0fd3b49..2658b8e 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/services/ApplicationConfig.h +++ b/Trenser.Zenvy/Trenser.Zenvy/services/ApplicationConfig.h @@ -1,3 +1,9 @@ +/* + * File: ApplicationConfig.h + * Description: Global Application Config + * Author: Trenser + * Created: 06-Apr-2026 + */ #pragma once namespace Config diff --git a/Trenser.Zenvy/Trenser.Zenvy/services/AttendanceManagementService.cpp b/Trenser.Zenvy/Trenser.Zenvy/services/AttendanceManagementService.cpp index fb3ab62..35ae237 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/services/AttendanceManagementService.cpp +++ b/Trenser.Zenvy/Trenser.Zenvy/services/AttendanceManagementService.cpp @@ -1 +1,7 @@ +/* + * File: AttendanceManagementService.cpp + * Description: Handles Attendance related operations + * Author: Trenser + * Created: 30-Apr-2026 + */ #include "AttendanceManagementService.h" diff --git a/Trenser.Zenvy/Trenser.Zenvy/services/AttendanceManagementService.h b/Trenser.Zenvy/Trenser.Zenvy/services/AttendanceManagementService.h index 64374bf..a97103e 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/services/AttendanceManagementService.h +++ b/Trenser.Zenvy/Trenser.Zenvy/services/AttendanceManagementService.h @@ -1,3 +1,9 @@ +/* + * File: AttendanceManagementService.h + * Description: Handles Attendance related operations + * Author: Trenser + * Created: 30-Apr-2026 + */ #pragma once class AttendanceManagementService { diff --git a/Trenser.Zenvy/Trenser.Zenvy/services/AuthenticationManagementService.cpp b/Trenser.Zenvy/Trenser.Zenvy/services/AuthenticationManagementService.cpp index ccb90fb..4abd1ea 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/services/AuthenticationManagementService.cpp +++ b/Trenser.Zenvy/Trenser.Zenvy/services/AuthenticationManagementService.cpp @@ -1,7 +1,24 @@ +/* + * File: AuthenticationManagementService.cpp + * Description: Handles authentication related operations + * Author: Trenser + * Created: 30-Mar-2026 + */ #include #include "AuthenticationManagementService.h" #include "ApplicationConfig.h" +/* + * Function: login + * Description: Authenticates a user using email and password, determines login status, + * employee type, and designation, and sets the authenticated employee + * in the data store. + * Parameters: + * email - employee email address + * password - employee password + * Returns: + * AuthenticationDTO containing login status, employee type, and employee designation + */ AuthenticationDTO AuthenticationManagementService::login(const std::string& email, const std::string& password) { employeeMap& employees = m_dataStore.getEmployees(); @@ -29,7 +46,7 @@ AuthenticationDTO AuthenticationManagementService::login(const std::string& emai employeeType = employee.second->getEmployeeType(); if (employeeType == Enums::EmployeeType::GENERAL) { - std::shared_ptr generalEmployee = std::dynamic_pointer_cast(employee.second); + GeneralEmployee* generalEmployee = dynamic_cast(employee.second); if (generalEmployee) { employeeDesignation = generalEmployee->getDesignation(); @@ -51,24 +68,46 @@ AuthenticationDTO AuthenticationManagementService::login(const std::string& emai return std::make_tuple(loginStatus, employeeType, employeeDesignation); } +/* + * Function: changePassword + * Description: Updates the password of the currently authenticated user. + * Parameters: + * password - new password to be set + * Returns: + * None + * Throws: + * runtime_error if no authenticated user is found + */ void AuthenticationManagementService::changePassword(const std::string& password) { - std::shared_ptr authenticatedUser = m_dataStore.getAuthenticatedEmployee(); - if (authenticatedUser) - { - authenticatedUser->setEmployeePassword(password); - } - else - { - throw std::runtime_error("User not found"); - } + Employee* authenticatedUser = m_dataStore.getAuthenticatedEmployee(); + if (authenticatedUser) + { + authenticatedUser->setEmployeePassword(password); + } + else + { + throw std::runtime_error("User not found"); + } } +/* + * Function: logout + * Description: Logs out the currently authenticated user by clearing authentication data. + * Parameters: + * None + * Returns: + * None + * Throws: + * runtime_error if no user is currently logged in + */ void AuthenticationManagementService::logout() { - if (m_dataStore.getAuthenticatedEmployee()) { + if (m_dataStore.getAuthenticatedEmployee()) + { m_dataStore.getAuthenticatedEmployee() = nullptr; } - else { + else + { throw std::runtime_error("No user currently logged In..."); } } \ No newline at end of file diff --git a/Trenser.Zenvy/Trenser.Zenvy/services/AuthenticationManagementService.h b/Trenser.Zenvy/Trenser.Zenvy/services/AuthenticationManagementService.h index f838311..b4669d4 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/services/AuthenticationManagementService.h +++ b/Trenser.Zenvy/Trenser.Zenvy/services/AuthenticationManagementService.h @@ -1,3 +1,9 @@ +/* + * File: AuthenticationManagementService.h + * Description: Handles authentication related operations + * Author: Trenser + * Created: 30-Mar-2026 + */ #pragma once #include #include @@ -18,5 +24,4 @@ public: AuthenticationDTO login(const std::string& username, const std::string& password); void logout(); void changePassword(const std::string&); -}; - +}; \ No newline at end of file diff --git a/Trenser.Zenvy/Trenser.Zenvy/services/BookingManagementService.cpp b/Trenser.Zenvy/Trenser.Zenvy/services/BookingManagementService.cpp index db5a4c9..2545535 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/services/BookingManagementService.cpp +++ b/Trenser.Zenvy/Trenser.Zenvy/services/BookingManagementService.cpp @@ -1 +1,7 @@ +/* + * File: BookingManagementService.cpp + * Description: Handle operations related to booking meetings + * Author: Trenser + * Created: 30-Mar-2026 + */ #include "BookingManagementService.h" diff --git a/Trenser.Zenvy/Trenser.Zenvy/services/BookingManagementService.h b/Trenser.Zenvy/Trenser.Zenvy/services/BookingManagementService.h index 75d7d57..258ad18 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/services/BookingManagementService.h +++ b/Trenser.Zenvy/Trenser.Zenvy/services/BookingManagementService.h @@ -1,3 +1,9 @@ +/* + * File: BookingManagementService.h + * Description: Handle operations related to booking meetings + * Author: Trenser + * Created: 30-Mar-2026 + */ #pragma once class BookingManagementService { diff --git a/Trenser.Zenvy/Trenser.Zenvy/services/EmployeeManagementService.cpp b/Trenser.Zenvy/Trenser.Zenvy/services/EmployeeManagementService.cpp index 855e445..c5751bf 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/services/EmployeeManagementService.cpp +++ b/Trenser.Zenvy/Trenser.Zenvy/services/EmployeeManagementService.cpp @@ -1,3 +1,11 @@ +/* + * File: EmployeeManagementService.h + * Description: Provides services for managing employees, including creation, deactivation, + * designation updates, profile modifications, searching, and retrieval of + * shortlisted candidates. + * Author: Trenser + * Created: 07-Apr-2026 + */ #include #include #include @@ -15,17 +23,30 @@ #include "FileManager.h" #include "ApplicationConfig.h" + /* + * Function: createEmployee + * Description: Creates a new employee of the specified type and designation, validates + * email and phone, enforces authorization, and associates payroll. + * Parameters: + * employeeType - type of employee (HR, IT, Finance, Team, Talent Acquisition, General) + * employeeDesignation - designation for general employees (Junior, Senior) + * email - employee email address + * name - employee name + * phone - employee phone number + * Returns: + * None + */ void EmployeeManagementService::createEmployee(Enums::EmployeeType employeeType, Enums::EmployeeDesignation employeeDesignation, const std::string& email, const std::string& name, const std::string& phone) { auto& employees = m_dataStore.getEmployees(); - std::shared_ptr authenticatedEmployee = m_dataStore.getAuthenticatedEmployee(); + Employee* authenticatedEmployee = m_dataStore.getAuthenticatedEmployee(); if (!authenticatedEmployee) { throw std::runtime_error("No authenticated user"); } Enums::EmployeeType authenticatedEmployeeType = authenticatedEmployee->getEmployeeType(); - std::shared_ptr employee; - std::shared_ptr payroll; + Employee* employee = nullptr; + Payroll* payroll = nullptr; if (employeeType != Enums::EmployeeType::GENERAL && util::hasActiveEmployeeOfType(employeeType, employees)) { throw std::runtime_error("Cannot create more than one employee of type " + Enums::getEmployeeTypeString(employeeType)); @@ -113,6 +134,16 @@ void EmployeeManagementService::createEmployee(Enums::EmployeeType employeeType, m_dataStore.getPayrolls().emplace(std::make_pair(payroll->getId(), payroll)); m_dataStore.getEmployees().emplace(std::make_pair(employee->getId(), employee)); } + +/* + * Function: deactivateEmployee + * Description: Deactivates an employee account by setting its status to INACTIVE. + * Prevents deactivation of Admin accounts. + * Parameters: + * id - unique identifier of the employee + * Returns: + * bool - true if deactivation succeeded, false otherwise + */ bool EmployeeManagementService::deactivateEmployee(const std::string& id) { auto& authenticatedEmployee = m_dataStore.getAuthenticatedEmployee(); @@ -131,17 +162,26 @@ bool EmployeeManagementService::deactivateEmployee(const std::string& id) return true; } + /* + * Function: updateDesignation + * Description: Updates the designation of a general employee. + * Parameters: + * id - unique identifier of the employee + * designation - new designation to assign + * Returns: + * bool - true if update succeeded, false otherwise + */ bool EmployeeManagementService::updateDesignation(const std::string& id, Enums::EmployeeDesignation designation) { auto& authenticatedEmployee = m_dataStore.getAuthenticatedEmployee(); util::enforceAuthorization(authenticatedEmployee->getEmployeeType(), Enums::EmployeeType::ADMIN, Enums::EmployeeType::HR); - std::map> employees = m_dataStore.getEmployees(); + std::map employees = m_dataStore.getEmployees(); auto employeeIterator = employees.find(id); if (employeeIterator == employees.end()) { return false; } - auto generalEmployee = std::dynamic_pointer_cast((*employeeIterator).second); + auto generalEmployee = dynamic_cast((*employeeIterator).second); if (generalEmployee) { generalEmployee->setDesignation(designation); @@ -149,24 +189,50 @@ bool EmployeeManagementService::updateDesignation(const std::string& id, Enums:: return true; } -std::shared_ptr EmployeeManagementService::getCurrentEmployee() +/* + * Function: getCurrentEmployee + * Description: Retrieves the currently authenticated employee from the DataStore. + * Parameters: + * None + * Returns: + * const Employee* - pointer to the current employee + */ +const Employee* EmployeeManagementService::getCurrentEmployee() { return m_dataStore.getAuthenticatedEmployee(); } +/* + * Function: updateProfile + * Description: Updates the name and phone number of the currently authenticated employee. + * Parameters: + * name - new employee name + * phone - new employee phone number + * Returns: + * None + */ void EmployeeManagementService::updateProfile(const std::string& name,const std::string& phone) { - std::shared_ptr employee = m_dataStore.getAuthenticatedEmployee(); + Employee* employee = m_dataStore.getAuthenticatedEmployee(); employee->setEmployeeName(name); employee->setEmployeePhone(phone); } -std::pair>> EmployeeManagementService::searchEmployee(const std::string& name) +/* + * Function: searchEmployee + * Description: Searches employees by name and returns matches along + * with the type of the current authenticated employee. + * Parameters: + * name - search string for employee name + * Returns: + * pair> - current user type and matching employees + */ +std::pair> EmployeeManagementService::searchEmployee(const std::string& name) { - std::shared_ptr currentUser = m_dataStore.getAuthenticatedEmployee(); + Employee* currentUser = m_dataStore.getAuthenticatedEmployee(); Enums::EmployeeType employeeType = currentUser->getEmployeeType(); employeeMap& employees = m_dataStore.getEmployees(); - std::vector> employeeList; + std::vector employeeList; if (employees.empty()) { return std::make_pair(employeeType, employeeList); @@ -189,6 +255,36 @@ std::pair>> Emp return { employeeType, employeeList }; } +/* + * Function: getShorlistedCandidates + * Description: Retrieves candidates with status SHORTLISTED from the DataStore. + * Parameters: + * None + * Returns: + * vector - list of shortlisted candidates + */ +std::vector EmployeeManagementService::getShorlistedCandidates() +{ + candidateMap candidates = m_dataStore.getCandidates(); + std::vector shortlistedCandidates; + for (auto& candidate : candidates) + { + if (candidate.second->getCandidateStatus() == Enums::CandidateStatus::SHORTLISTED) + { + shortlistedCandidates.push_back(candidate.second); + } + } + return shortlistedCandidates; +} + +/* + * Function: loadEmployees + * Description: Loads employees and general employees from FileManager into the DataStore. + * Parameters: + * None + * Returns: + * None + */ void EmployeeManagementService::loadEmployees() { FileManager employeeFileManager(Config::File::EMPLOYEES_FILE); @@ -214,18 +310,26 @@ void EmployeeManagementService::loadEmployees() } } +/* + * Function: saveEmployees + * Description: Saves employees and general employees from the DataStore into FileManager. + * Parameters: + * None + * Returns: + * None + */ void EmployeeManagementService::saveEmployees() { FileManager employeeFileManager(Config::File::EMPLOYEES_FILE); FileManager generalEmployeeFileManager(Config::File::GENERAL_EMPLOYEES_FILE); const auto& allEmployees = m_dataStore.getEmployees(); employeeMap employees; - std::map> generalEmployees; + std::map generalEmployees; for (auto& employeePair : allEmployees) { if (employeePair.second->getEmployeeType() == Enums::EmployeeType::GENERAL) { - generalEmployees.emplace(employeePair.first, std::static_pointer_cast(employeePair.second)); + generalEmployees.emplace(employeePair.first, static_cast(employeePair.second)); } else { @@ -234,18 +338,4 @@ void EmployeeManagementService::saveEmployees() } employeeFileManager.save(employees); generalEmployeeFileManager.save(generalEmployees); -} - -std::vector> EmployeeManagementService::getShorlistedCandidates() -{ - candidateMap candidates = m_dataStore.getCandidates(); - std::vector> shortlistedCandidates; - for (auto& candidate : candidates) - { - if (candidate.second->getCandidateStatus() == Enums::CandidateStatus::SHORTLISTED) - { - shortlistedCandidates.push_back(candidate.second); - } - } - return shortlistedCandidates; } \ No newline at end of file diff --git a/Trenser.Zenvy/Trenser.Zenvy/services/EmployeeManagementService.h b/Trenser.Zenvy/Trenser.Zenvy/services/EmployeeManagementService.h index a292c31..b819a8b 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/services/EmployeeManagementService.h +++ b/Trenser.Zenvy/Trenser.Zenvy/services/EmployeeManagementService.h @@ -1,3 +1,11 @@ +/* + * File: EmployeeManagementService.h + * Description: Provides services for managing employees, including creation, deactivation, + * designation updates, profile modifications, searching, and retrieval of + * shortlisted candidates. + * Author: Trenser + * Created: 07-Apr-2026 + */ #pragma once #include #include @@ -7,24 +15,33 @@ #include "Enums.h" #include "StringHelper.h" -using Employees = std::vector>; +using Employees = std::vector; class EmployeeManagementService { private: - DataStore& m_dataStore; + DataStore& m_dataStore; public: - EmployeeManagementService() : m_dataStore(DataStore::getInstance()) {}; - void createEmployee(Enums::EmployeeType, Enums::EmployeeDesignation, const std::string&, const std::string&, const std::string&); - bool deactivateEmployee(const std::string&); - bool updateDesignation(const std::string&,Enums::EmployeeDesignation); - void updateProfile(const std::string&,const std::string&); - std::pair>> searchEmployee(const std::string&); - std::shared_ptr getCurrentEmployee(); - std::vector> getShorlistedCandidates(); - void loadEmployees(); - void saveEmployees(); + EmployeeManagementService() : m_dataStore(DataStore::getInstance()) {}; + void createEmployee(Enums::EmployeeType, Enums::EmployeeDesignation, const std::string&, const std::string&, const std::string&); + bool deactivateEmployee(const std::string&); + bool updateDesignation(const std::string&, Enums::EmployeeDesignation); + void updateProfile(const std::string&, const std::string&); + std::pair> searchEmployee(const std::string&); + const Employee* getCurrentEmployee(); + std::vector getShorlistedCandidates(); + void loadEmployees(); + void saveEmployees(); + /* + * Function: getEmployees (template) + * Description: Retrieves active employees filtered by specified types. Excludes admin employees + * if no filter is provided. + * Parameters: + * types... - variadic list of employee types + * Returns: + * Employees - vector of pointers to filtered employees + */ template Employees getEmployees(Types... types) { @@ -52,8 +69,8 @@ public: std::sort( filteredEmployees.begin(), filteredEmployees.end(), - [](const std::shared_ptr& employeeOne, - const std::shared_ptr& employeeTwo) + [](const Employee* employeeOne, + const Employee* employeeTwo) { return util::extractNumber(employeeOne->getId()) < util::extractNumber(employeeTwo->getId()); @@ -61,4 +78,4 @@ public: ); return filteredEmployees; } -}; +}; \ No newline at end of file diff --git a/Trenser.Zenvy/Trenser.Zenvy/services/LeaveManagementService.cpp b/Trenser.Zenvy/Trenser.Zenvy/services/LeaveManagementService.cpp index a40f268..647154e 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/services/LeaveManagementService.cpp +++ b/Trenser.Zenvy/Trenser.Zenvy/services/LeaveManagementService.cpp @@ -1 +1,7 @@ +/* + * File: LeaveManagementService.cpp + * Description: Handle operations related to leaves + * Author: Trenser + * Created: 30-Mar-2026 + */ #include "LeaveManagementService.h" diff --git a/Trenser.Zenvy/Trenser.Zenvy/services/LeaveManagementService.h b/Trenser.Zenvy/Trenser.Zenvy/services/LeaveManagementService.h index 6447f13..40b2c4b 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/services/LeaveManagementService.h +++ b/Trenser.Zenvy/Trenser.Zenvy/services/LeaveManagementService.h @@ -1,3 +1,9 @@ +/* + * File: LeaveManagementService.h + * Description: Handle operations related to leaves + * Author: Trenser + * Created: 30-Mar-2026 + */ #pragma once class LeaveManagementService { diff --git a/Trenser.Zenvy/Trenser.Zenvy/services/LogService.cpp b/Trenser.Zenvy/Trenser.Zenvy/services/LogService.cpp index 1742a3d..1f68ffe 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/services/LogService.cpp +++ b/Trenser.Zenvy/Trenser.Zenvy/services/LogService.cpp @@ -1,12 +1,27 @@ +/* + * File: Log.cpp + * Description: Handle operations related to logging + * Author: Trenser + * Created: 01-Apr-2026 + */ #include "LogService.h" #include "Log.h" #include "Factory.h" #include "DataStore.h" + /* + * Function: log + * Description: Creates a new log entry with the given message, assigns a timestamp, + * and stores it in the DataStore. + * Parameters: + * message - string containing the log message to be recorded + * Returns: + * void - no return value + */ void LogService::log(const std::string& message) { DataStore& dataStore = DataStore::getInstance(); logMap& logs = dataStore.getLogs(); - std::shared_ptr log = Factory::getObject(message); + Log* log = Factory::getObject(message); logs.emplace(std::make_pair(log->getTimestamp(), log)); -} +} \ No newline at end of file diff --git a/Trenser.Zenvy/Trenser.Zenvy/services/LogService.h b/Trenser.Zenvy/Trenser.Zenvy/services/LogService.h index 6918b25..416d4ba 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/services/LogService.h +++ b/Trenser.Zenvy/Trenser.Zenvy/services/LogService.h @@ -1,3 +1,9 @@ +/* + * File: Log.h + * Description: Handle operations related to logging + * Author: Trenser + * Created: 01-Apr-2026 + */ #pragma once #include "Log.h" @@ -5,4 +11,4 @@ class LogService { public: static void log(const std::string&); -}; +}; \ No newline at end of file diff --git a/Trenser.Zenvy/Trenser.Zenvy/services/NotificationManagementService.cpp b/Trenser.Zenvy/Trenser.Zenvy/services/NotificationManagementService.cpp index cc23059..f7f94a7 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/services/NotificationManagementService.cpp +++ b/Trenser.Zenvy/Trenser.Zenvy/services/NotificationManagementService.cpp @@ -1 +1,7 @@ +/* + * File: NotificationManagementService.cpp + * Description: Handle operations related to notifications + * Author: Trenser + * Created: 30-Mar-2026 + */ #include "NotificationManagementService.h" diff --git a/Trenser.Zenvy/Trenser.Zenvy/services/NotificationManagementService.h b/Trenser.Zenvy/Trenser.Zenvy/services/NotificationManagementService.h index f976574..cef9bfc 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/services/NotificationManagementService.h +++ b/Trenser.Zenvy/Trenser.Zenvy/services/NotificationManagementService.h @@ -1,5 +1,10 @@ +/* + * File: NotificationManagementService.h + * Description: Handle operations related to notifications + * Author: Trenser + * Created: 30-Mar-2026 + */ #pragma once class NotificationManagementService { }; - diff --git a/Trenser.Zenvy/Trenser.Zenvy/services/PayslipManagementService.cpp b/Trenser.Zenvy/Trenser.Zenvy/services/PayslipManagementService.cpp index 7c74f9a..685d487 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/services/PayslipManagementService.cpp +++ b/Trenser.Zenvy/Trenser.Zenvy/services/PayslipManagementService.cpp @@ -1,3 +1,9 @@ +/* + * File: PayslipManagementService.cpp + * Description: Handle operations related to employee payslips + * Author: Trenser + * Created: 30-Mar-2026 + */ #include #include #include "PayslipManagementService.h" @@ -7,6 +13,20 @@ #include "FileManager.h" #include "Factory.h" + /* + * Function: updateSalary + * Description: Updates the payroll details of a given employee, including salary components + * and PF contributions. + * Parameters: + * employeeId - unique identifier of the employee + * basicSalary - basic salary of the employee + * houseRentAllowance - HRA component + * foodAllowance - food allowance component + * employeePFContribution - employee PF contribution + * employerPFContribution - employer PF contribution + * Returns: + * void - throws runtime_error if employee not found or unauthorized + */ void PayslipManagementService::updateSalary(const std::string& employeeId, double basicSalary, double houseRentAllowance, double foodAllowance, double employeePFContribution, double employerPFContribution) { util::enforceAuthorization(m_dataStore.getAuthenticatedEmployee()->getEmployeeType(), Enums::EmployeeType::FINANCE); @@ -26,6 +46,14 @@ void PayslipManagementService::updateSalary(const std::string& employeeId, doubl } } + /* + * Function: generatePayslips + * Description: Generates payslips for all employees for the current month and year. + * Parameters: + * None + * Returns: + * void - creates and stores payslips in DataStore + */ void PayslipManagementService::generatePayslips() { util::enforceAuthorization(m_dataStore.getAuthenticatedEmployee()->getEmployeeType(), Enums::EmployeeType::FINANCE); @@ -55,13 +83,22 @@ void PayslipManagementService::generatePayslips() auto payroll = employee->getPayroll(); double salary; salary = payroll->getBasicSalary() + payroll->getFoodAllowance() + payroll->getHouseRentAllowance() - payroll->getEmployeePFContribution() - payroll->getEmployerPFContribution(); - std::shared_ptr payslip = Factory::getObject(salary, employee->getId()); + Payslip* payslip = Factory::getObject(salary, employee->getId()); employee->addPayslip(payslip); payslips.emplace(payslip->getId(), payslip); } } } + /* + * Function: loadPayrolls + * Description: Loads payroll objects from persistent storage and associates them + * with existing employees. + * Parameters: + * None + * Returns: + * void - updates DataStore with loaded payrolls + */ void PayslipManagementService::loadPayrolls() { FileManager payrollFileManager(Config::File::PAYROLL_FILE); @@ -80,6 +117,14 @@ void PayslipManagementService::loadPayrolls() payrolls.insert(payrollObjects.begin(), payrollObjects.end()); } + /* + * Function: savePayrolls + * Description: Saves all payroll objects from DataStore into persistent storage. + * Parameters: + * None + * Returns: + * None + */ void PayslipManagementService::savePayrolls() { FileManager payrollFileManager(Config::File::PAYROLL_FILE); @@ -87,7 +132,18 @@ void PayslipManagementService::savePayrolls() payrollFileManager.save(payrolls); } -std::pair, std::shared_ptr> PayslipManagementService::getPayslipForMonth(const std::string& employeeId, int year, int month) + /* + * Function: getPayslipForMonth + * Description: Retrieves the payroll and payslip of a given employee for a specific + * month and year. + * Parameters: + * employeeId - unique identifier of the employee + * year - year of the payslip + * month - month of the payslip + * Returns: + * pair - payroll and payslip for the given month. + */ +std::pair PayslipManagementService::getPayslipForMonth(const std::string& employeeId, int year, int month) { auto& employees = m_dataStore.getEmployees(); auto employeeIterator = employees.find(employeeId); @@ -110,6 +166,15 @@ std::pair, std::shared_ptr> PayslipManagementS return { nullptr, nullptr }; } + /* + * Function: loadPayslips + * Description: Loads payslip objects from FileManager and associates them + * with existing employees. + * Parameters: + * None + * Returns: + * void - updates DataStore with loaded payslips + */ void PayslipManagementService::loadPayslips() { FileManager payslipFileManager(Config::File::PAYSLIP_FILE); @@ -128,9 +193,17 @@ void PayslipManagementService::loadPayslips() payslips.insert(payslipObjects.begin(), payslipObjects.end()); } + /* + * Function: savePayslips + * Description: Saves all payslip objects from DataStore into FileManager. + * Parameters: + * None + * Returns: + * void + */ void PayslipManagementService::savePayslips() { FileManager payslipFileManager(Config::File::PAYSLIP_FILE); auto& payslips = m_dataStore.getPayslips(); payslipFileManager.save(payslips); -} +} \ No newline at end of file diff --git a/Trenser.Zenvy/Trenser.Zenvy/services/PayslipManagementService.h b/Trenser.Zenvy/Trenser.Zenvy/services/PayslipManagementService.h index cf72793..6d1e5cc 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/services/PayslipManagementService.h +++ b/Trenser.Zenvy/Trenser.Zenvy/services/PayslipManagementService.h @@ -1,9 +1,15 @@ +/* + * File: PayslipManagementService.h + * Description: Handle operations related to employee payslips + * Author: Trenser + * Created: 30-Mar-2026 + */ #pragma once #include #include #include"DataStore.h" -using payslipMap = std::map>; +using payslipMap = std::map; class PayslipManagementService { @@ -13,7 +19,7 @@ public: PayslipManagementService() : m_dataStore(DataStore::getInstance()) {}; void updateSalary(const std::string&, double, double, double, double, double); void generatePayslips(); - std::pair, std::shared_ptr>getPayslipForMonth(const std::string&, int, int); + std::pairgetPayslipForMonth(const std::string&, int, int); void loadPayrolls(); void savePayrolls(); void loadPayslips(); diff --git a/Trenser.Zenvy/Trenser.Zenvy/services/TalentAcquisitionManagementService.cpp b/Trenser.Zenvy/Trenser.Zenvy/services/TalentAcquisitionManagementService.cpp index 5fd0d2d..3fb9113 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/services/TalentAcquisitionManagementService.cpp +++ b/Trenser.Zenvy/Trenser.Zenvy/services/TalentAcquisitionManagementService.cpp @@ -1 +1,7 @@ +/* + * File: TalentAcquisitionManagementService.cpp + * Description: Handle operations related to Talent Acquisition + * Author: Trenser + * Created: 30-Mar-2026 + */ #include "TalentAcquisitionManagementService.h" diff --git a/Trenser.Zenvy/Trenser.Zenvy/services/TalentAcquisitionManagementService.h b/Trenser.Zenvy/Trenser.Zenvy/services/TalentAcquisitionManagementService.h index 855dda7..c120c72 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/services/TalentAcquisitionManagementService.h +++ b/Trenser.Zenvy/Trenser.Zenvy/services/TalentAcquisitionManagementService.h @@ -1,5 +1,10 @@ +/* + * File: TalentAcquisitionManagementService.h + * Description: Handle operations related to Talent Acquisition + * Author: Trenser + * Created: 30-Mar-2026 + */ #pragma once class TalentAcquisitionManagementService { }; - diff --git a/Trenser.Zenvy/Trenser.Zenvy/services/TeamManagementService.cpp b/Trenser.Zenvy/Trenser.Zenvy/services/TeamManagementService.cpp index f78fe48..5db2995 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/services/TeamManagementService.cpp +++ b/Trenser.Zenvy/Trenser.Zenvy/services/TeamManagementService.cpp @@ -1 +1,7 @@ +/* + * File: TeamManagementService.cpp + * Description: Handle operations related to Team Management + * Author: Trenser + * Created: 30-Mar-2026 + */ #include "TeamManagementService.h" diff --git a/Trenser.Zenvy/Trenser.Zenvy/services/TeamManagementService.h b/Trenser.Zenvy/Trenser.Zenvy/services/TeamManagementService.h index 918229d..eabb859 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/services/TeamManagementService.h +++ b/Trenser.Zenvy/Trenser.Zenvy/services/TeamManagementService.h @@ -1,3 +1,9 @@ +/* + * File: TeamManagementService.h + * Description: Handle operations related to Team Management + * Author: Trenser + * Created: 30-Mar-2026 + */ #pragma once class TeamManagementService { diff --git a/Trenser.Zenvy/Trenser.Zenvy/services/TicketManagementService.cpp b/Trenser.Zenvy/Trenser.Zenvy/services/TicketManagementService.cpp index 4649010..0325609 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/services/TicketManagementService.cpp +++ b/Trenser.Zenvy/Trenser.Zenvy/services/TicketManagementService.cpp @@ -1 +1,7 @@ +/* + * File: TicketManagementService.h + * Description: Handle operations related to Ticket Management + * Author: Trenser + * Created: 30-Mar-2026 + */ #include "TicketManagementService.h" diff --git a/Trenser.Zenvy/Trenser.Zenvy/services/TicketManagementService.h b/Trenser.Zenvy/Trenser.Zenvy/services/TicketManagementService.h index 1db345b..caa6338 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/services/TicketManagementService.h +++ b/Trenser.Zenvy/Trenser.Zenvy/services/TicketManagementService.h @@ -1,3 +1,9 @@ +/* + * File: TicketManagementService.h + * Description: Handle operations related to Ticket Management + * Author: Trenser + * Created: 30-Mar-2026 + */ #pragma once class TicketManagementService { diff --git a/Trenser.Zenvy/Trenser.Zenvy/utilities/AuthorizationHelper.h b/Trenser.Zenvy/Trenser.Zenvy/utilities/AuthorizationHelper.h index e9c4d4b..9f5690f 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/utilities/AuthorizationHelper.h +++ b/Trenser.Zenvy/Trenser.Zenvy/utilities/AuthorizationHelper.h @@ -1,14 +1,40 @@ +/* + * File: AuthorizationHelper.h + * Description : Provides utility functions to check and enforce authorization + * based on allowed employee types. + * Author : Trenser + * Created : 07-Apr-2026 + */ #pragma once #include #include "Enums.h" namespace util { + /* + * Function: isAuthorized + * Description: Checks if the current employee type matches the specified allowed type. + * Parameters: + * current - the employee type of the current user + * first - the allowed employee type to compare against + * Returns: + * bool - true if current matches the allowed type, false otherwise + */ inline bool isAuthorized(Enums::EmployeeType current, Enums::EmployeeType first) { return current == first; } + /* + * Function: isAuthorized + * Description: Checks if the current employee type matches any of the specified allowed types. + * Parameters: + * current - the employee type of the current user + * first - the first allowed employee type + * rest - additional allowed employee types + * Returns: + * bool - true if current matches any of the allowed types, false otherwise + */ template inline bool isAuthorized(Enums::EmployeeType current, Enums::EmployeeType first, Rest... rest) @@ -20,6 +46,16 @@ namespace util return isAuthorized(current, rest...); } + /* + * Function: enforceAuthorization + * Description: Enforces authorization by checking if the current employee type + * is among the allowed types. + * Parameters: + * current - the employee type of the current user + * alloweds - one or more allowed employee types + * Returns: + * void - throws runtime_error if current is not authorized + */ template inline void enforceAuthorization(Enums::EmployeeType current, Allowed... allowed) { @@ -28,4 +64,4 @@ namespace util throw std::runtime_error("You are unauthorized to perform this operation!"); } } -} +} \ No newline at end of file diff --git a/Trenser.Zenvy/Trenser.Zenvy/utilities/Enums.h b/Trenser.Zenvy/Trenser.Zenvy/utilities/Enums.h index 0ac464a..1bef70f 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/utilities/Enums.h +++ b/Trenser.Zenvy/Trenser.Zenvy/utilities/Enums.h @@ -1,21 +1,28 @@ +/* + * File: Enums.h + * Description: Defines strongly typed enumerations for statuses, types, and designations used across the HRMS system. + * Author: Smitha + * Created: 01-04-2026 + */ + #pragma once #include namespace Enums { - enum class AccountStatus + enum class AccountStatus { ACTIVE, INACTIVE }; - enum class TeamStatus + enum class TeamStatus { IN_TEAM, NOT_IN_TEAM }; - enum class CandidateStatus + enum class CandidateStatus { PENDING, SHORTLISTED, @@ -109,6 +116,14 @@ namespace Enums { INVALID }; + /* + * Function: getAccountStatusString + * Description: Converts AccountStatus enum value to string. + * Parameters: + * status - account status enum + * Returns: + * std::string - string representation of status + */ inline std::string getAccountStatusString(AccountStatus status) { switch (status) @@ -122,6 +137,14 @@ namespace Enums { } } + /* + * Function: getEmployeeTypeString + * Description: Converts EmployeeType enum value to string. + * Parameters: + * type - employee type enum + * Returns: + * std::string - string representation of employee type + */ inline std::string getEmployeeTypeString(EmployeeType type) { switch (type) @@ -147,6 +170,14 @@ namespace Enums { } } + /* + * Function: getTeamStatusString + * Description: Converts TeamStatus enum value to string. + * Parameters: + * status - team status enum + * Returns: + * std::string - string representation of team status + */ inline std::string getTeamStatusString(TeamStatus status) { switch (status) @@ -160,6 +191,14 @@ namespace Enums { } } + /* + * Function: getEmployeeDesignationString + * Description: Converts EmployeeDesignation enum value to string. + * Parameters: + * designation - employee designation enum + * Returns: + * std::string - string representation of designation + */ inline std::string getEmployeeDesignationString(EmployeeDesignation designation) { switch (designation) @@ -177,9 +216,17 @@ namespace Enums { } } - inline std::string getCandidateStatusString(CandidateStatus status) + /* + * Function: getCandidateStatusString + * Description: Converts CandidateStatus enum value to string. + * Parameters: + * status - candidate status enum + * Returns: + * std::string - string representation of candidate status + */ + inline std::string getCandidateStatusString(CandidateStatus status) { - switch (status) + switch (status) { case CandidateStatus::PENDING: return "Pending"; case CandidateStatus::SHORTLISTED: return "Shortlisted"; @@ -188,41 +235,57 @@ namespace Enums { } } + /* + * Function: getMonthString + * Description: Converts Month enum value to month name. + * Parameters: + * month - month enum + * Returns: + * std::string - month name + */ inline std::string getMonthString(Month month) { switch (month) { - case Month::JANUARY : + case Month::JANUARY: return "January"; - case Month::FEBRUARY: + case Month::FEBRUARY: return "February"; - case Month::MARCH: + case Month::MARCH: return "March"; - case Month::APRIL: + case Month::APRIL: return "April"; - case Month::MAY: + case Month::MAY: return "May"; - case Month::JUNE: + case Month::JUNE: return "June"; - case Month::JULY: + case Month::JULY: return "July"; - case Month::AUGUST: + case Month::AUGUST: return "August"; - case Month::SEPTEMBER: + case Month::SEPTEMBER: return "September"; - case Month::OCTOBER: + case Month::OCTOBER: return "October"; - case Month::NOVEMBER: + case Month::NOVEMBER: return "November"; - case Month::DECEMBER: + case Month::DECEMBER: return "December"; - case Month::INVALID: + case Month::INVALID: return "Invalid Month"; - default: + default: return "Unknown"; } } + /* + * Function: getAccountStatus + * Description: Converts string to AccountStatus enum. + * Parameters: + * input - string representation of account status + * Returns: + * AccountStatus - enum value + */ inline AccountStatus getAccountStatus(const std::string& input) { if (input == "ACTIVE") @@ -236,6 +299,14 @@ namespace Enums { return AccountStatus::INACTIVE; } + /* + * Function: getEmployeeType + * Description: Converts string to EmployeeType enum. + * Parameters: + * input - string representation of employee type + * Returns: + * EmployeeType - enum value + */ inline EmployeeType getEmployeeType(const std::string& input) { if (input == "GENERAL") @@ -269,6 +340,14 @@ namespace Enums { return EmployeeType::INVALID; } + /* + * Function: getTeamStatus + * Description: Converts string to TeamStatus enum. + * Parameters: + * str - string representation of team status + * Returns: + * TeamStatus - enum value + */ inline TeamStatus getTeamStatus(const std::string& str) { if (str == "IN_TEAM") @@ -282,6 +361,14 @@ namespace Enums { return TeamStatus::NOT_IN_TEAM; } + /* + * Function: getEmployeeDesignation + * Description: Converts string to EmployeeDesignation enum. + * Parameters: + * input - string representation of designation + * Returns: + * EmployeeDesignation - enum value + */ inline EmployeeDesignation getEmployeeDesignation(const std::string& input) { if (input == "JUNIOR") @@ -298,39 +385,46 @@ namespace Enums { } return EmployeeDesignation::INVALID; } - + + /* + * Function: getMonth + * Description: Converts integer to Month enum. + * Parameters: + * inputMonth - month number (1–12) + * Returns: + * Month - enum value + */ inline Month getMonth(const int inputMonth) { switch (inputMonth) { - case 1: + case 1: return Month::JANUARY; - case 2: + case 2: return Month::FEBRUARY; - case 3: + case 3: return Month::MARCH; - case 4: + case 4: return Month::APRIL; - case 5: + case 5: return Month::MAY; - case 6: + case 6: return Month::JUNE; - case 7: + case 7: return Month::JULY; - case 8: + case 8: return Month::AUGUST; - case 9: + case 9: return Month::SEPTEMBER; - case 10: + case 10: return Month::OCTOBER; - case 11: + case 11: return Month::NOVEMBER; - case 12: + case 12: return Month::DECEMBER; - default: + default: return Month::INVALID; } } -} - +} \ No newline at end of file diff --git a/Trenser.Zenvy/Trenser.Zenvy/utilities/InputHelper.h b/Trenser.Zenvy/Trenser.Zenvy/utilities/InputHelper.h index a82c0a3..eb23b24 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/utilities/InputHelper.h +++ b/Trenser.Zenvy/Trenser.Zenvy/utilities/InputHelper.h @@ -1,3 +1,9 @@ +/* + * File: InputHelper.h + * Description: Handles input validation and error handling + * Author: Smitha + * Created: 08-Apr-2026 + */ #pragma once #include #include @@ -6,6 +12,14 @@ 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 inline void read(T& value) { @@ -17,11 +31,25 @@ 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) { 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() { std::cout << std::endl; diff --git a/Trenser.Zenvy/Trenser.Zenvy/utilities/OutputHelper.cpp b/Trenser.Zenvy/Trenser.Zenvy/utilities/OutputHelper.cpp index a8e0f7c..e113f4f 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/utilities/OutputHelper.cpp +++ b/Trenser.Zenvy/Trenser.Zenvy/utilities/OutputHelper.cpp @@ -1,5 +1,18 @@ +/* + * File: OutputHelper.cpp + * Description: Provides functions to help with console output. + * Author: Trenser + * Created: 01-04-2026 +*/ #include "outputHelper.h" +/* +* Function: clear +* Description: Clears the console screen output. +* Parameters: None +* Returns: +* void - no return value +*/ void util::clear() { std::cout << "\x1B[2J\x1B[H" << std::flush; diff --git a/Trenser.Zenvy/Trenser.Zenvy/utilities/OutputHelper.h b/Trenser.Zenvy/Trenser.Zenvy/utilities/OutputHelper.h index a40dbaf..0c17c57 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/utilities/OutputHelper.h +++ b/Trenser.Zenvy/Trenser.Zenvy/utilities/OutputHelper.h @@ -1,3 +1,9 @@ +/* + * File: OutputHelper.h + * Description: Provides functions to help with console output. + * Author: Trenser + * Created: 01-04-2026 +*/ #pragma once #include diff --git a/Trenser.Zenvy/Trenser.Zenvy/utilities/StringHelper.cpp b/Trenser.Zenvy/Trenser.Zenvy/utilities/StringHelper.cpp index 00af011..2f32a39 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/utilities/StringHelper.cpp +++ b/Trenser.Zenvy/Trenser.Zenvy/utilities/StringHelper.cpp @@ -1,6 +1,20 @@ +/* + * File: StringHelper.cpp + * Description: Provides functions to help with string manipulation. + * Author: Trenser + * Created: 10-04-2026 +*/ #include "StringHelper.h" #include +/* + * Function: extractNumber + * Description: Extracts and returns the numeric value formed by digits in the input string. + * Parameters: + * input - string containing numeric and non-numeric characters + * Returns: + * int - number extracted from the input string + */ int util::extractNumber(const std::string& input) { int result = 0; @@ -12,4 +26,4 @@ int util::extractNumber(const std::string& input) } } return result; -} +} \ No newline at end of file diff --git a/Trenser.Zenvy/Trenser.Zenvy/utilities/StringHelper.h b/Trenser.Zenvy/Trenser.Zenvy/utilities/StringHelper.h index 12df49a..cc6e74a 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/utilities/StringHelper.h +++ b/Trenser.Zenvy/Trenser.Zenvy/utilities/StringHelper.h @@ -1,3 +1,9 @@ +/* + * File: StringHelper.h + * Description: Provides functions to help with string manipulation. + * Author: Trenser + * Created: 10-04-2026 +*/ #pragma once #include diff --git a/Trenser.Zenvy/Trenser.Zenvy/utilities/Timestamp.cpp b/Trenser.Zenvy/Trenser.Zenvy/utilities/Timestamp.cpp index 1341da9..ba581db 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/utilities/Timestamp.cpp +++ b/Trenser.Zenvy/Trenser.Zenvy/utilities/Timestamp.cpp @@ -1,18 +1,52 @@ +/* + * 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 #include #include #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() { 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) { 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) { std::tm timeStruct = {}; @@ -26,6 +60,14 @@ util::Timestamp util::Timestamp::fromString(const std::string& timeString) 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::tm timeStruct = {}; @@ -35,11 +77,28 @@ std::string util::Timestamp::toString() const 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) { 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 { std::tm timeStruct{}; @@ -50,6 +109,14 @@ int util::Timestamp::getDateAsInt() const return year * 10000 + month * 100 + day; } +/* +* Function: getMonth +* Description: Extracts the month value from the timestamp. +* Parameters: +* None +* Returns: +* int - month value (1 to 12) +*/ int util::Timestamp::getMonth() const { std::tm timeStruct{}; @@ -57,6 +124,14 @@ int util::Timestamp::getMonth() const return timeStruct.tm_mon + 1; } +/* +* Function: getYear +* Description: Extracts the year value from the timestamp. +* Parameters: +* None +* Returns: +* int - year value +*/ int util::Timestamp::getYear() const { std::tm timeStruct{}; @@ -64,6 +139,14 @@ int util::Timestamp::getYear() const return timeStruct.tm_year + 1900; } +/* +* Function: getDay +* Description: Extracts the day value from the timestamp. +* Parameters: +* None +* Returns: +* int - day of the month +*/ int util::Timestamp::getDay() const { std::tm timeStruct{}; @@ -71,37 +154,95 @@ int util::Timestamp::getDay() const return timeStruct.tm_mday; } +/* +* 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) { 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) { 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 { 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 { 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 { 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 { 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 { return m_time == other.m_time; -} +} \ No newline at end of file diff --git a/Trenser.Zenvy/Trenser.Zenvy/utilities/Timestamp.h b/Trenser.Zenvy/Trenser.Zenvy/utilities/Timestamp.h index 8aedc35..56a6a0b 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/utilities/Timestamp.h +++ b/Trenser.Zenvy/Trenser.Zenvy/utilities/Timestamp.h @@ -1,3 +1,11 @@ +/* + * 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 #include #include diff --git a/Trenser.Zenvy/Trenser.Zenvy/utilities/Validator.cpp b/Trenser.Zenvy/Trenser.Zenvy/utilities/Validator.cpp index ee99e68..5b1631c 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/utilities/Validator.cpp +++ b/Trenser.Zenvy/Trenser.Zenvy/utilities/Validator.cpp @@ -1,8 +1,24 @@ +/* + * File: Validator.cpp + * Description: Validates inputs like phone number, email, password + * Author: Trenser + * Created: 01-Apr-2026 + */ + +#include #include #include "Validator.h" #include "Employee.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) { if (phoneNumber.size() != 10) { @@ -16,6 +32,14 @@ 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) { size_t index = email.find('@'); if (index == std::string::npos) @@ -33,7 +57,19 @@ bool util::isEmailValid(const std::string& email) { 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) { if (password == Config::Authentication::DEFAULT_PASSWORD) @@ -73,7 +109,16 @@ bool util::isPasswordValid(const std::string& password) return hasUpper && hasLower && hasDigit && hasSpecial; } -bool util::hasActiveEmployeeOfType(Enums::EmployeeType employeeType, const std::map> & employees) +/* + * Function: hasActiveEmployeeOfType + * Description: Checks whether there is any active employee of the given employee type. + * Parameters: + * employeeType - the type of employee to check against + * employees - map of employee ID to Employee* objects + * Returns: + * bool - true if an active employee of the given type exists, otherwise false + */ +bool util::hasActiveEmployeeOfType(Enums::EmployeeType employeeType, const std::map& employees) { for (const auto& employeePair : employees) { @@ -86,7 +131,16 @@ bool util::hasActiveEmployeeOfType(Enums::EmployeeType employeeType, const std:: return false; } -bool util::isEmailDuplicate(const std::string& email, const std::map>& employees) +/* + * Function: isEmailDuplicate + * Description: Checks if an email already exists among the given employees. + * Parameters: + * email - the email address to check + * employees - map of employee ID to Employee* objects + * Returns: + * bool - true if a duplicate email is found, otherwise false + */ +bool util::isEmailDuplicate(const std::string& email, const std::map& employees) { for (const auto& employeePair : employees) { @@ -99,7 +153,16 @@ bool util::isEmailDuplicate(const std::string& email, const std::map>& employees) +/* + * Function: isPhoneDuplicate + * Description: Checks if a phone number already exists among the given employees. + * Parameters: + * phone - the phone number to check + * employees - map of employee ID to Employee* objects + * Returns: + * bool - true if a duplicate phone number is found, otherwise false + */ +bool util::isPhoneDuplicate(const std::string& phone, const std::map& employees) { for (const auto& employeePair : employees) { @@ -112,7 +175,16 @@ bool util::isPhoneDuplicate(const std::string& phone, const std::map>& employees) +/* + * Function: isPhoneDuplicate (overloaded) + * Description: Checks if a phone number already exists in a vector of employees. + * Parameters: + * phone - the phone number to check + * employees - vector of Employee* pointers + * Returns: + * bool - true if a duplicate phone number is found, otherwise false + */ +bool util::isPhoneDuplicate(const std::string& phone, const std::vector& employees) { for (const auto& employee : employees) { diff --git a/Trenser.Zenvy/Trenser.Zenvy/utilities/Validator.h b/Trenser.Zenvy/Trenser.Zenvy/utilities/Validator.h index 588b820..eaef165 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/utilities/Validator.h +++ b/Trenser.Zenvy/Trenser.Zenvy/utilities/Validator.h @@ -1,3 +1,9 @@ +/* + * File: Validator.h + * Description: Validates inputs like phone number, email, password + * Author: Trenser + * Created: 01-Apr-2026 + */ #pragma once #include #include @@ -14,8 +20,8 @@ namespace util bool isPhoneNumberValid(const std::string&); bool isEmailValid(const std::string&); bool isPasswordValid(const std::string&); - bool hasActiveEmployeeOfType(Enums::EmployeeType, const std::map>&); - bool isEmailDuplicate(const std::string&, const std::map>&); - bool isPhoneDuplicate(const std::string&, const std::map>&); - bool isPhoneDuplicate(const std::string&, const std::vector>&); + bool hasActiveEmployeeOfType(Enums::EmployeeType, const std::map&); + bool isEmailDuplicate(const std::string&, const std::map&); + bool isPhoneDuplicate(const std::string&, const std::map&); + bool isPhoneDuplicate(const std::string&, const std::vector&); } \ No newline at end of file diff --git a/Trenser.Zenvy/Trenser.Zenvy/views/AdminMenu.cpp b/Trenser.Zenvy/Trenser.Zenvy/views/AdminMenu.cpp index df08e23..c8b0019 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/views/AdminMenu.cpp +++ b/Trenser.Zenvy/Trenser.Zenvy/views/AdminMenu.cpp @@ -1,9 +1,24 @@ +/* + * File: AdminMenu.cpp + * Description: Handles user-related operations such as creation, authentication, and validation. + * Author: Trenser + * Created: 02-Apr-2026 + */ #include #include "AdminMenu.h" #include"InputHelper.h" #include"OutputHelper.h" #include "MenuHelper.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() { bool isMenuActive = true; @@ -28,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) { switch (choice) @@ -60,4 +84,4 @@ bool AdminMenu::handleOperation(int choice) util::pressEnter(); } return true; -} +} \ No newline at end of file diff --git a/Trenser.Zenvy/Trenser.Zenvy/views/AdminMenu.h b/Trenser.Zenvy/Trenser.Zenvy/views/AdminMenu.h index dab23c5..39fda7c 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/views/AdminMenu.h +++ b/Trenser.Zenvy/Trenser.Zenvy/views/AdminMenu.h @@ -1,14 +1,18 @@ +/* + * File: AdminMenu.h + * Description: Declaration of the AdminMenu class and related functions. + * Author: Trenser + * Created: 02-Apr-2026 + */ #pragma once -#include #include"ZenvyController.h" class AdminMenu { private: - std::shared_ptr m_zenvyController; + ZenvyController* m_zenvyController; public: - AdminMenu() :m_zenvyController(std::make_shared()) {}; + AdminMenu() :m_zenvyController(new ZenvyController()) {}; void run(); bool handleOperation(int); -}; - +}; \ No newline at end of file diff --git a/Trenser.Zenvy/Trenser.Zenvy/views/EmployeeMenu.cpp b/Trenser.Zenvy/Trenser.Zenvy/views/EmployeeMenu.cpp index 8749ad8..2a81bfc 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/views/EmployeeMenu.cpp +++ b/Trenser.Zenvy/Trenser.Zenvy/views/EmployeeMenu.cpp @@ -1,3 +1,9 @@ +/* + * File: EmployeeMenu.cpp + * Description: Implements the EmployeeMenu class functions including menu loop and operation handling. + * Author: Trenser + * Created: 02-Apr-2026 + */ #include #include #include "EmployeeMenu.h" @@ -5,6 +11,14 @@ #include "OutputHelper.h" #include "MenuHelper.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() { bool isMenuActive = true; @@ -14,7 +28,7 @@ void EmployeeMenu::run() { int choice; util::clear(); - std::cout << "Employee Menu\n1. Apply Leave\n2. View Payslip\n3. View Payslip History\n4. Raise Ticket\n5. View Ticket\n6. View Ticket History\n7. View Employees\n8. Search Employee\n9. View Team Members\n10. Book Meeting Room\n11. View Booking History\n12. View Notification\n13. View Announcements\n14. Update Profile\n15. View Profile\n16. Exit\nEnter your Choice: "; + std::cout << "Employee Menu\n1. Apply Leave\n2. View Payslip\n3. View Payslip History\n4. Raise Ticket\n5. View Ticket\n6. View Ticket History\n7. View Employees\n8. Search Employee\n9. View Team Members\n10. Book Meeting Room\n11. View Booking History\n12. View Notifications\n13. View Announcements\n14. Update Profile\n15. View Profile\n16. Exit\nEnter your Choice: "; util::read(choice); if (!handleOperation(choice)) { @@ -29,6 +43,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) { switch (choice) @@ -58,4 +81,4 @@ bool EmployeeMenu::handleOperation(int choice) util::pressEnter(); } return true; -} +} \ No newline at end of file diff --git a/Trenser.Zenvy/Trenser.Zenvy/views/EmployeeMenu.h b/Trenser.Zenvy/Trenser.Zenvy/views/EmployeeMenu.h index f082b66..579903e 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/views/EmployeeMenu.h +++ b/Trenser.Zenvy/Trenser.Zenvy/views/EmployeeMenu.h @@ -1,14 +1,18 @@ +/* + * File: EmployeeMenu.h + * Description: Declaration of the EmployeeMenu class and related functions. + * Author: Trenser + * Created: 02-Apr-2026 + */ #pragma once -#include #include"ZenvyController.h" class EmployeeMenu { private: - std::shared_ptr m_zenvyController; + ZenvyController* m_zenvyController; public: - EmployeeMenu() : m_zenvyController(std::make_shared()) {}; + EmployeeMenu() : m_zenvyController(new ZenvyController()) {}; void run(); bool handleOperation(int); -}; - +}; \ No newline at end of file diff --git a/Trenser.Zenvy/Trenser.Zenvy/views/FinanceExecutiveMenu.cpp b/Trenser.Zenvy/Trenser.Zenvy/views/FinanceExecutiveMenu.cpp index 2bfd221..b301167 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/views/FinanceExecutiveMenu.cpp +++ b/Trenser.Zenvy/Trenser.Zenvy/views/FinanceExecutiveMenu.cpp @@ -1,3 +1,9 @@ +/* + * File: FinanceExecutiveMenu.cpp + * Description: Implements the FinanceExecutiveMenu class functions including menu loop and operation handling. + * Author: Trenser + * Created: 02-Apr-2026 + */ #include #include "FinanceExecutiveMenu.h" #include "InputHelper.h" @@ -5,6 +11,14 @@ #include "MenuHelper.h" #include "Timestamp.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() { bool isMenuActive = true; @@ -14,7 +28,7 @@ void FinanceExecutiveMenu::run() { int choice; util::clear(); - std::cout << "Finance Executive Menu\n1. Apply Leave\n2. View Payslip\n3. View Payslip History\n4. View Employees\n5. Search Employee\n6. View Notification\n7. View Announcements\n8. Resolve Ticket\n9. Generate Payslips\n10. Update Payroll\n11. Update Profile\n12. View Profile \n13. Logout\nEnter your Choice: "; + std::cout << "Finance Executive Menu\n1. Apply Leave\n2. View Payslip\n3. View Payslip History\n4. View Employees\n5. Search Employee\n6. View Notifications\n7. View Announcements\n8. Resolve Ticket\n9. Generate Payslips\n10. Update Payroll\n11. Update Profile\n12. View Profile \n13. Logout\nEnter your Choice: "; util::read(choice); if (!handleOperation(choice)) { @@ -61,6 +75,15 @@ void FinanceExecutiveMenu::generatePayslips() util::pressEnter(); } +/* + * 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) { switch (choice) @@ -96,4 +119,4 @@ bool FinanceExecutiveMenu::handleOperation(int choice) util::pressEnter(); } return true; -} +} \ No newline at end of file diff --git a/Trenser.Zenvy/Trenser.Zenvy/views/FinanceExecutiveMenu.h b/Trenser.Zenvy/Trenser.Zenvy/views/FinanceExecutiveMenu.h index d757a03..69097da 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/views/FinanceExecutiveMenu.h +++ b/Trenser.Zenvy/Trenser.Zenvy/views/FinanceExecutiveMenu.h @@ -1,3 +1,9 @@ +/* + * File: FinanceExecutiveMenu.h + * Description: Declaration of the FinanceExecutiveMenu class and related functions. + * Author: Trenser + * Created: 02-Apr-2026 + */ #pragma once #include #include @@ -8,12 +14,11 @@ class FinanceExecutiveMenu { private: - std::shared_ptr m_zenvyController; + ZenvyController* m_zenvyController; public: - FinanceExecutiveMenu() : m_zenvyController(std::make_shared()) {}; + FinanceExecutiveMenu() : m_zenvyController(new ZenvyController()) {}; void run(); bool handleOperation(int); void updatePayroll(); void generatePayslips(); -}; - +}; \ No newline at end of file diff --git a/Trenser.Zenvy/Trenser.Zenvy/views/HRManagerMenu.cpp b/Trenser.Zenvy/Trenser.Zenvy/views/HRManagerMenu.cpp index 8c76ecb..d72e29f 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/views/HRManagerMenu.cpp +++ b/Trenser.Zenvy/Trenser.Zenvy/views/HRManagerMenu.cpp @@ -1,9 +1,23 @@ +/* + * File: HRManagerMenu.cpp + * Description: Implements the HRManagerMenu class functions including menu loop and operation handling. + * Author: Trenser + * Created: 02-Apr-2026 + */ #include #include "HRManagerMenu.h" #include "InputHelper.h" #include "OutputHelper.h" #include "MenuHelper.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() { bool isMenuActive = true; @@ -13,7 +27,7 @@ void HRManagerMenu::run() { int choice; util::clear(); - std::cout << "HR Manager Menu\n1. Apply Leave\n2. View Payslip\n3. View Payslip History\n4. View Employees\n5. Search Employee\n6. View Notification\n7. View Announcements\n8. Create Employee\n9. Regularize Attendance\n10. Update Leave Request\n11. Update Profile\n12. Deactivate Employee\n13. View Profile\n14. Update Designation\n15. Add Shortlisted Candidate as Employee\n16. Logout\nEnter your Choice: "; + std::cout << "HR Manager Menu\n1. Apply Leave\n2. View Payslip\n3. View Payslip History\n4. View Employees\n5. Search Employee\n6. View Notifications\n7. View Announcements\n8. Create Employee\n9. Regularize Attendance\n10. Update Leave Request\n11. Update Profile\n12. Deactivate Employee\n13. View Profile\n14. Update Designation\n15. Add Shortlisted Candidate as Employee\n16. Logout\nEnter your Choice: "; util::read(choice); if (!handleOperation(choice)) { @@ -28,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) { switch (choice) @@ -69,4 +92,4 @@ bool HRManagerMenu::handleOperation(int choice) util::pressEnter(); } return true; -} +} \ No newline at end of file diff --git a/Trenser.Zenvy/Trenser.Zenvy/views/HRManagerMenu.h b/Trenser.Zenvy/Trenser.Zenvy/views/HRManagerMenu.h index 05e1f41..b455bc9 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/views/HRManagerMenu.h +++ b/Trenser.Zenvy/Trenser.Zenvy/views/HRManagerMenu.h @@ -1,14 +1,18 @@ +/* + * File: HRManagerMenu.h + * Description: Declaration of the EmployeeMenu class and related functions. + * Author: Trenser + * Created: 02-Apr-2026 + */ #pragma once -#include #include"ZenvyController.h" class HRManagerMenu { private: - std::shared_ptr m_zenvyController; + ZenvyController* m_zenvyController; public: - HRManagerMenu() : m_zenvyController(std::make_shared()) {}; + HRManagerMenu() : m_zenvyController(new ZenvyController()) {}; void run(); bool handleOperation(int); -}; - +}; \ No newline at end of file diff --git a/Trenser.Zenvy/Trenser.Zenvy/views/ITExecutiveMenu.cpp b/Trenser.Zenvy/Trenser.Zenvy/views/ITExecutiveMenu.cpp index cdc1c74..ec94afd 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/views/ITExecutiveMenu.cpp +++ b/Trenser.Zenvy/Trenser.Zenvy/views/ITExecutiveMenu.cpp @@ -1,9 +1,23 @@ +/* + * File: ITExecutiveMenu.cpp + * Description: Implements the ITExecutiveMenu class functions including menu loop and operation handling. + * Author: Trenser + * Created: 02-Apr-2026 + */ #include #include "ITExecutiveMenu.h" #include "InputHelper.h" #include "OutputHelper.h" #include "MenuHelper.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() { bool isMenuActive = true; @@ -13,7 +27,7 @@ void ITExecutiveMenu::run() { int choice; util::clear(); - std::cout << "IT Executive Menu\n1. Apply Leave\n2. View Payslip\n3. View Payslip History\n4. View Employees\n5. Search Employee\n6. View Notification\n7. View Announcements\n8. Resolve Ticket\n9. Update Profile\n10. View Profile\n11. Logout\nEnter your Choice: "; + std::cout << "IT Executive Menu\n1. Apply Leave\n2. View Payslip\n3. View Payslip History\n4. View Employees\n5. Search Employee\n6. View Notifications\n7. View Announcements\n8. Resolve Ticket\n9. Update Profile\n10. View Profile\n11. Logout\nEnter your Choice: "; util::read(choice); if (!handleOperation(choice)) { @@ -28,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) { switch (choice) @@ -57,4 +80,4 @@ bool ITExecutiveMenu::handleOperation(int choice) util::pressEnter(); } return true; -} +} \ No newline at end of file diff --git a/Trenser.Zenvy/Trenser.Zenvy/views/ITExecutiveMenu.h b/Trenser.Zenvy/Trenser.Zenvy/views/ITExecutiveMenu.h index 1c5f060..a1817cd 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/views/ITExecutiveMenu.h +++ b/Trenser.Zenvy/Trenser.Zenvy/views/ITExecutiveMenu.h @@ -1,14 +1,18 @@ +/* + * File: ITExecutiveMenu.h + * Description: Declaration of the ITExecutiveMenu class and related functions. + * Author: Trenser + * Created: 02-Apr-2026 + */ #pragma once -#include #include"ZenvyController.h" class ITExecutiveMenu { private: - std::shared_ptr m_zenvyController; + ZenvyController* m_zenvyController; public: - ITExecutiveMenu() : m_zenvyController(std::make_shared()) {}; + ITExecutiveMenu() : m_zenvyController(new ZenvyController()) {}; void run(); bool handleOperation(int); -}; - +}; \ No newline at end of file diff --git a/Trenser.Zenvy/Trenser.Zenvy/views/MenuHelper.cpp b/Trenser.Zenvy/Trenser.Zenvy/views/MenuHelper.cpp index bba68d0..95d10d9 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/views/MenuHelper.cpp +++ b/Trenser.Zenvy/Trenser.Zenvy/views/MenuHelper.cpp @@ -1,6 +1,22 @@ +/* + * File: MenuHelper.cpp + * Description: Inline functions and utilities for employee management, + * including profile handling, payslip viewing, search, + * and employee activation/deactivation. + * Author: Trenser + * Created: 08-Apr-2026 + */ #include #include "MenuHelper.h" +/* + * Function: getEmployeeType + * Description: Retrieves a valid employee type based on the authority of the current user + * Parameters: + * employeeType - the type of the employee requesting to create another employee + * Returns: + * Enums::EmployeeType - selected employee type or INVALID if choice is invalid + */ static Enums::EmployeeType getEmployeeType(Enums::EmployeeType employeeType) { int choice; @@ -50,6 +66,13 @@ static Enums::EmployeeType getEmployeeType(Enums::EmployeeType employeeType) return Enums::EmployeeType::INVALID; } +/* + * Function: getEmployeeDesignation + * Description: Retrieves the designation (Senior or Junior) for a new employee + * Parameters: None + * Returns: + * Enums::EmployeeDesignation - selected designation or INVALID if choice is invalid + */ static Enums::EmployeeDesignation getEmployeeDesignation() { int choice; @@ -70,9 +93,16 @@ static Enums::EmployeeDesignation getEmployeeDesignation() } } -void createEmployee(std::shared_ptr controller) +/* + * Function: createEmployee + * Description: Creates a new employee record and adds it to the system + * Parameters: + * m_zenvyController - pointer to the ZenvyController managing employees + * Returns: void + */ +void createEmployee(ZenvyController* m_zenvyController) { - auto currentEmployee = controller->getCurrentEmployee(); + auto currentEmployee = m_zenvyController->getCurrentEmployee(); Enums::EmployeeType employeeType = getEmployeeType(currentEmployee->getEmployeeType()); Enums::EmployeeDesignation employeeDesignation = Enums::EmployeeDesignation::INVALID; std::string name, email, phone; @@ -98,12 +128,19 @@ void createEmployee(std::shared_ptr controller) util::read(email); std::cout << "Enter Phone: "; util::read(phone); - controller->createEmployee(employeeType, employeeDesignation, email, name, phone); + m_zenvyController->createEmployee(employeeType, employeeDesignation, email, name, phone); std::cout << "\nCreated Employee Successfully."; util::pressEnter(); } - void updateDesignation(std::shared_ptr m_zenvyController) +/* + * Function: updateDesignation + * Description: Updates the designation of an existing employee + * Parameters: + * m_zenvyController - pointer to the ZenvyController managing employees + * Returns: void + */ + void updateDesignation(ZenvyController* m_zenvyController) { std::string selectedEmployeeId = selectEmployeeId(m_zenvyController->getEmployees(Enums::EmployeeType::GENERAL)); if (selectedEmployeeId.empty()) @@ -123,7 +160,14 @@ void createEmployee(std::shared_ptr controller) } } -void displayCandidateDetails(const std::vector>& shorlistedCandidates) + /* + * Function: displayCandidateDetails + * Description: Displays details of shortlisted candidates + * Parameters: + * shorlistedCandidates - vector of candidate pointers to display + * Returns: void + */ +void displayCandidateDetails(const std::vector shorlistedCandidates) { util::clear(); std::cout << std::left @@ -148,12 +192,19 @@ void displayCandidateDetails(const std::vector>& shor } } -void addShortlistedCandidateAsEmployee(const std::shared_ptr& controller) +/* + * Function: addShortlistedCandidateAsEmployee + * Description: Converts a shortlisted candidate into an employee record + * Parameters: + * m_zenvyController - pointer to the ZenvyController managing employees + * Returns: void + */ +void addShortlistedCandidateAsEmployee(const ZenvyController* m_zenvyController) { int index; std::string name, email, phone; util::clear(); - std::vector> shortlistedCandidates = controller->getShorlistedCandidates(); + std::vector shortlistedCandidates = m_zenvyController->getShorlistedCandidates(); if (shortlistedCandidates.empty()) { std::cout << "No candidates Found!"; @@ -163,13 +214,13 @@ void addShortlistedCandidateAsEmployee(const std::shared_ptr& c displayCandidateDetails(shortlistedCandidates); std::cout << "Enter the Index: "; util::read(index); - auto currentEmployee = controller->getCurrentEmployee(); + auto currentEmployee = m_zenvyController->getCurrentEmployee(); Enums::EmployeeType employeeType; Enums::EmployeeDesignation employeeDesignation = Enums::EmployeeDesignation::INVALID; if (index > 0 && index <= shortlistedCandidates.size()) { employeeType = getEmployeeType(currentEmployee->getEmployeeType()); - std::shared_ptr candidate = shortlistedCandidates[index - 1]; + Candidate* candidate = shortlistedCandidates[index - 1]; switch (employeeType) { case Enums::EmployeeType::INVALID: @@ -190,7 +241,7 @@ void addShortlistedCandidateAsEmployee(const std::shared_ptr& c util::read(email); name = candidate->getCandidateName(); phone = candidate->getCandidatePhone(); - controller->createEmployee(employeeType, employeeDesignation, email, name, phone); + m_zenvyController->createEmployee(employeeType, employeeDesignation, email, name, phone); candidate->setCandidateStatus(Enums::CandidateStatus::HIRED); std::cout << "\nCreated Employee Successfully."; util::pressEnter(); @@ -199,4 +250,4 @@ void addShortlistedCandidateAsEmployee(const std::shared_ptr& c { throw std::runtime_error("Enter a valid Index."); } -} +} \ No newline at end of file diff --git a/Trenser.Zenvy/Trenser.Zenvy/views/MenuHelper.h b/Trenser.Zenvy/Trenser.Zenvy/views/MenuHelper.h index cd82082..1f892fb 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/views/MenuHelper.h +++ b/Trenser.Zenvy/Trenser.Zenvy/views/MenuHelper.h @@ -1,6 +1,13 @@ +/* + * File: MenuHelper.h + * Description: Inline functions and utilities for employee management, + * including profile handling, payslip viewing, search, + * and employee activation/deactivation. + * Author: Trenser + * Created: 08-Apr-2026 + */ #pragma once #include -#include #include #include #include @@ -15,12 +22,21 @@ #include "MenuHelper.h" #include "Validator.h" -void createEmployee(std::shared_ptr controller); -void updateDesignation(std::shared_ptr m_zenvyController); +void createEmployee(ZenvyController* m_zenvyController); +void updateDesignation(ZenvyController* m_zenvyController); +void displayCandidateDetails(const std::vector shorlistedCandidates); +void addShortlistedCandidateAsEmployee(const ZenvyController* m_zenvyController); -inline void viewPayslipHistory(std::shared_ptr controller) +/* + * Function: viewPayslipHistory + * Description: Displays the payslip history of the current employee + * Parameters: + * m_zenvyController - pointer to the ZenvyController managing employees + * Returns: void + */ +inline void viewPayslipHistory(ZenvyController* m_zenvyController) { - auto employeePayslips = controller->getCurrentEmployee()->getEmployeePayslips(); + auto& employeePayslips = m_zenvyController->getCurrentEmployee()->getEmployeePayslips(); util::clear(); if (employeePayslips.empty()) { @@ -51,10 +67,17 @@ inline void viewPayslipHistory(std::shared_ptr controller) util::pressEnter(); } -inline void viewProfile(std::shared_ptr controller) +/* + * Function: viewProfile + * Description: Displays the profile details of the current employee + * Parameters: + * m_zenvyController - pointer to the ZenvyController managing employees + * Returns: void + */ +inline void viewProfile(ZenvyController* m_zenvyController) { util::clear(); - std::shared_ptr currentEmployee = controller->getCurrentEmployee(); + const Employee* currentEmployee = m_zenvyController->getCurrentEmployee(); if (currentEmployee) { std::cout << std::left @@ -64,7 +87,7 @@ inline void viewProfile(std::shared_ptr controller) << "Email: " << currentEmployee->getEmployeeEmail() << std::endl << "Phone: " << currentEmployee->getEmployeePhone() << std::endl; if (currentEmployee->getEmployeeType() == Enums::EmployeeType::GENERAL) { - if (auto generalEmployee = std::dynamic_pointer_cast(currentEmployee)) + if (auto generalEmployee = dynamic_cast(currentEmployee)) { std::cout << "Designation: " << Enums::getEmployeeDesignationString(generalEmployee->getDesignation()) << std::endl; } @@ -94,10 +117,14 @@ inline void viewProfile(std::shared_ptr controller) } } -void displayCandidateDetails(const std::vector>& shorlistedCandidates); -void addShortlistedCandidateAsEmployee(const std::shared_ptr& controller); - -inline void updateProfile(std::shared_ptr m_zenvyController) +/* + * Function: updateProfile + * Description: Allows the current employee to update their profile information + * Parameters: + * m_zenvyController - pointer to the ZenvyController managing employees + * Returns: void + */ +inline void updateProfile(ZenvyController* m_zenvyController) { int choice; std::string name, phone; @@ -148,10 +175,18 @@ inline void updateProfile(std::shared_ptr m_zenvyController) } } -inline std::string selectEmployeeId(std::vector> allEmployees) +/* + * Function: selectEmployeeId + * Description: Displays a list of employees and allows selection by index + * Parameters: + * allEmployees - vector of employee pointers to choose from + * Returns: + * string - selected employee ID + */ +inline std::string selectEmployeeId(const std::vector& allEmployees) { int choice; - std::map> employeeList; + std::map employeeList; int index = 0; util::clear(); if (allEmployees.empty()) @@ -177,7 +212,7 @@ inline std::string selectEmployeeId(std::vector> << std::setw(20) << "Employee Designation" << std::endl; for (const auto& employee : employeeList) { - auto generalEmployee = std::dynamic_pointer_cast(employee.second); + auto generalEmployee = dynamic_cast(employee.second); std::cout << std::left << std::setw(10) << employee.first << std::setw(15) << employee.second->getId() @@ -209,14 +244,21 @@ inline std::string selectEmployeeId(std::vector> } } -inline void deactivateEmployee(const std::shared_ptr& controller) +/* + * Function: deactivateEmployee + * Description: Deactivates an employee based on selection + * Parameters: + * m_zenvyController - pointer to the ZenvyController managing employees + * Returns: void + */ +inline void deactivateEmployee(const ZenvyController* m_zenvyController) { - std::string selectedEmployeeId = selectEmployeeId(controller->getEmployees()); + std::string selectedEmployeeId = selectEmployeeId(m_zenvyController->getEmployees()); if (selectedEmployeeId.empty()) { return; } - if (controller->deactivateEmployee(selectedEmployeeId)) + if (m_zenvyController->deactivateEmployee(selectedEmployeeId)) { std::cout << "Employee deactivated successfully\n"; util::pressEnter(); @@ -228,7 +270,14 @@ inline void deactivateEmployee(const std::shared_ptr& controlle } } -inline void viewEmployees(std::shared_ptr m_zenvyController) +/* + * Function: viewEmployees + * Description: Displays a list of all employees in the system + * Parameters: + * m_zenvyController - pointer to the ZenvyController managing employees + * Returns: void + */ +inline void viewEmployees(ZenvyController* m_zenvyController) { util::clear(); std::cout << "Employee List\n"; @@ -261,13 +310,20 @@ inline void viewEmployees(std::shared_ptr m_zenvyController) util::pressEnter(); } -inline void searchEmployee(std::shared_ptr m_zenvyController) +/* + * Function: searchEmployee + * Description: Searches for employees by name and displays matching results + * Parameters: + * m_zenvyController - pointer to the ZenvyController managing employees + * Returns: void + */ +inline void searchEmployee(ZenvyController* m_zenvyController) { std::string name; util::clear(); std::cout << "Enter Employee Name: "; util::read(name); - std::pair>> searchResults = m_zenvyController->searchEmployee(name); + std::pair> searchResults = m_zenvyController->searchEmployee(name); if (!(searchResults.second).empty()) { std::cout << std::left @@ -333,7 +389,14 @@ inline void searchEmployee(std::shared_ptr m_zenvyController) util::pressEnter(); } -inline void viewPayslip(std::shared_ptr controller) +/* + * Function: viewPayslip + * Description: Displays the payslip of the current employee for a given month and year + * Parameters: + * m_zenvyController - pointer to the ZenvyController managing employees + * Returns: void + */ +inline void viewPayslip(ZenvyController* m_zenvyController) { int year, month; util::clear(); @@ -341,20 +404,20 @@ inline void viewPayslip(std::shared_ptr controller) util::read(year); std::cout << "Enter the month: "; util::read(month); - auto employee = controller->getCurrentEmployee(); + auto employee = m_zenvyController->getCurrentEmployee(); if (!employee) { std::cout << "No authenticated employee.\n"; util::pressEnter(); return; } - auto result = controller->getPayslipForMonth(employee->getId(), year, month); + auto result = m_zenvyController->getPayslipForMonth(employee->getId(), year, month); auto payroll = result.first; auto payslip = result.second; if (payroll && payslip) { util::clear(); - std::cout << "Payslip for " << employee->getEmployeeName() << " (" << year << "-" << std::setw(2) << std::setfill('0') << month << ")\n\n"; + std::cout << "Payslip for " << employee->getEmployeeName() << " (" << year << "-" << std::setw(2) << month << ")\n\n"; std::cout << "Basic Salary : " << payroll->getBasicSalary() << "\n"; std::cout << "House Rent Allowance : " << payroll->getHouseRentAllowance() << "\n"; std::cout << "Food Allowance : " << payroll->getFoodAllowance() << "\n"; diff --git a/Trenser.Zenvy/Trenser.Zenvy/views/TalentExecutiveMenu.cpp b/Trenser.Zenvy/Trenser.Zenvy/views/TalentExecutiveMenu.cpp index e82c9df..a4897f0 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/views/TalentExecutiveMenu.cpp +++ b/Trenser.Zenvy/Trenser.Zenvy/views/TalentExecutiveMenu.cpp @@ -1,9 +1,23 @@ +/* + * File: TalentExecutiveMenu.cpp + * Description: Implements the TalentExecutiveMenu class functions including menu loop and operation handling. + * Author: Trenser + * Created: 02-Apr-2026 + */ #include #include "TalentExecutiveMenu.h" #include "InputHelper.h" #include "OutputHelper.h" #include "MenuHelper.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() { bool isMenuActive = true; @@ -13,7 +27,7 @@ void TalentExecutiveMenu::run() { int choice; util::clear(); - std::cout << "Talent Executive Menu\n1. Apply Leave\n2. View Payslip\n3. View Payslip History\n4. View Employees\n5. Search Employee\n6. View Notification\n7. View Announcements\n8. Create New Job\n9. View Job Opening\n10. Add Candidate\n11. UpdateCandidate Status\n12. View Shortlisted Candidate\n13. Update Profile\n14. View Profile\n15. Logout\nEnter your Choice: "; + std::cout << "Talent Executive Menu\n1. Apply Leave\n2. View Payslip\n3. View Payslip History\n4. View Employees\n5. Search Employee\n6. View Notifications\n7. View Announcements\n8. Create New Job\n9. View Job Opening\n10. Add Candidate\n11. Update Candidate Status\n12. View Shortlisted Candidate\n13. Update Profile\n14. View Profile\n15. Logout\nEnter your Choice: "; util::read(choice); if (!handleOperation(choice)) { @@ -28,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) { switch (choice) diff --git a/Trenser.Zenvy/Trenser.Zenvy/views/TalentExecutiveMenu.h b/Trenser.Zenvy/Trenser.Zenvy/views/TalentExecutiveMenu.h index a258eaf..e6847bc 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/views/TalentExecutiveMenu.h +++ b/Trenser.Zenvy/Trenser.Zenvy/views/TalentExecutiveMenu.h @@ -1,14 +1,18 @@ +/* + * File: TalentExecutiveMenu.h + * Description: Declaration of the TalentExecutiveMenu class and related functions. + * Author: Trenser + * Created: 02-Apr-2026 + */ #pragma once -#include #include"ZenvyController.h" class TalentExecutiveMenu { private: - std::shared_ptr m_zenvyController; + ZenvyController* m_zenvyController; public: - TalentExecutiveMenu() : m_zenvyController(std::make_shared < ZenvyController>()) {}; + TalentExecutiveMenu() : m_zenvyController(new ZenvyController()) {}; void run(); bool handleOperation(int); -}; - +}; \ No newline at end of file diff --git a/Trenser.Zenvy/Trenser.Zenvy/views/TeamExecutiveMenu.cpp b/Trenser.Zenvy/Trenser.Zenvy/views/TeamExecutiveMenu.cpp index 78f06a0..3110402 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/views/TeamExecutiveMenu.cpp +++ b/Trenser.Zenvy/Trenser.Zenvy/views/TeamExecutiveMenu.cpp @@ -1,9 +1,23 @@ +/* + * File: TeamExecutiveMenu.cpp + * Description: Implements the TeamExecutiveMenu class functions including menu loop and operation handling. + * Author: Trenser + * Created: 02-Apr-2026 + */ #include #include "TeamExecutiveMenu.h" #include "InputHelper.h" #include "OutputHelper.h" #include "MenuHelper.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() { bool isMenuActive = true; @@ -13,7 +27,7 @@ void TeamExecutiveMenu::run() { int choice; util::clear(); - std::cout << "Team Executive Menu\n1. Apply Leave\n2. View Payslip\n3. View Payslip History\n4. View Employees\n5. Search Employee\n6. View Notification\n7. View Announcements\n8. Create Team\n9. Update Team\n10. Remove Team\n11. Assign Employee\n12. Unassign Employee\n13. View Teams\n14. Update Profile\n15. View Profile\n16. Logout\nEnter your Choice: "; + std::cout << "Team Executive Menu\n1. Apply Leave\n2. View Payslip\n3. View Payslip History\n4. View Employees\n5. Search Employee\n6. View Notifications\n7. View Announcements\n8. Create Team\n9. Update Team\n10. Remove Team\n11. Assign Employee\n12. Unassign Employee\n13. View Teams\n14. Update Profile\n15. View Profile\n16. Logout\nEnter your Choice: "; util::read(choice); if (!handleOperation(choice)) { @@ -28,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) { switch (choice) diff --git a/Trenser.Zenvy/Trenser.Zenvy/views/TeamExecutiveMenu.h b/Trenser.Zenvy/Trenser.Zenvy/views/TeamExecutiveMenu.h index 4b5181d..21fd70a 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/views/TeamExecutiveMenu.h +++ b/Trenser.Zenvy/Trenser.Zenvy/views/TeamExecutiveMenu.h @@ -1,14 +1,18 @@ +/* + * File: TeamExecutiveMenu.h + * Description: Declaration of the TeamExecutiveMenu and related functions. + * Author: Trenser + * Created: 02-Apr-2026 + */ #pragma once -#include #include"ZenvyController.h" class TeamExecutiveMenu { private: - std::shared_ptr m_zenvyController; + ZenvyController* m_zenvyController; public: - TeamExecutiveMenu() : m_zenvyController(std::make_shared()) {}; + TeamExecutiveMenu() : m_zenvyController(new ZenvyController()) {}; void run(); bool handleOperation(int); -}; - +}; \ No newline at end of file diff --git a/Trenser.Zenvy/Trenser.Zenvy/views/TeamLeadMenu.cpp b/Trenser.Zenvy/Trenser.Zenvy/views/TeamLeadMenu.cpp index 740d7c7..40ca7c2 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/views/TeamLeadMenu.cpp +++ b/Trenser.Zenvy/Trenser.Zenvy/views/TeamLeadMenu.cpp @@ -1,9 +1,23 @@ +/* + * File: TeamLeadMenu.cpp + * Description: Implements the TeamLeadMenu class functions including menu loop and operation handling. + * Author: Trenser + * Created: 02-Apr-2026 + */ #include #include "TeamLeadMenu.h" #include "InputHelper.h" #include "OutputHelper.h" #include "MenuHelper.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() { bool isMenuActive = true; @@ -13,7 +27,7 @@ void TeamLeadMenu::run() { int choice; util::clear(); - std::cout << "Team Lead Menu\n1. Apply Leave\n2. View Payslip\n3. View Payslip History\n4. Raise Ticke\n5. View Ticket\n6. View Ticket History\n7. View Employees\n8. Search Employee\n9. View Team Members\n10. Book Meeting Room\n11. View Booking History\n12. View Notification\n13. View Announcements\n4. Regularize Attendance\n15. Update Leave Request\n16. Update Profile\n17. View Profile\n18. Logout\nEnter your Choice: "; + std::cout << "Team Lead Menu\n1. Apply Leave\n2. View Payslip\n3. View Payslip History\n4. Raise Ticket\n5. View Ticket\n6. View Ticket History\n7. View Employees\n8. Search Employee\n9. View Team Members\n10. Book Meeting Room\n11. View Booking History\n12. View Notifications\n13. View Announcements\n14. Regularize Attendance\n15. Update Leave Request\n16. Update Profile\n17. View Profile\n18. Logout\nEnter your Choice: "; util::read(choice); if (!handleOperation(choice)) { @@ -28,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) { switch (choice) diff --git a/Trenser.Zenvy/Trenser.Zenvy/views/TeamLeadMenu.h b/Trenser.Zenvy/Trenser.Zenvy/views/TeamLeadMenu.h index e1bd45b..2eabf24 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/views/TeamLeadMenu.h +++ b/Trenser.Zenvy/Trenser.Zenvy/views/TeamLeadMenu.h @@ -1,14 +1,18 @@ +/* + * File: TeamLeadMenu.h + * Description: Declaration of the TeamLeadMenu class and related functions. + * Author: Trenser + * Created: 02-Apr-2026 + */ #pragma once -#include #include"ZenvyController.h" class TeamLeadMenu { private: - std::shared_ptr m_zenvyController; + ZenvyController* m_zenvyController; public: - TeamLeadMenu() : m_zenvyController(std::make_shared()) {}; + TeamLeadMenu() : m_zenvyController(new ZenvyController()) {}; void run(); bool handleOperation(int); -}; - +}; \ No newline at end of file diff --git a/Trenser.Zenvy/Trenser.Zenvy/views/UserInterface.cpp b/Trenser.Zenvy/Trenser.Zenvy/views/UserInterface.cpp index f420867..50acbe5 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/views/UserInterface.cpp +++ b/Trenser.Zenvy/Trenser.Zenvy/views/UserInterface.cpp @@ -1,6 +1,11 @@ +/* + * 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 #include -#include #include #include "UserInterface.h" #include "AdminMenu.h" @@ -16,6 +21,14 @@ #include "OutputHelper.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() { bool isMenuActive = true; @@ -58,6 +71,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) { switch (choice) @@ -75,6 +97,14 @@ bool UserInterface::handleOperation(int choice) 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() { std::string email, password; @@ -118,7 +148,6 @@ void UserInterface::login() } } util::clear(); - // Route to appropriate menu switch (employeeType) { case Enums::EmployeeType::ADMIN: @@ -177,4 +206,17 @@ void UserInterface::login() break; } 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; } \ No newline at end of file diff --git a/Trenser.Zenvy/Trenser.Zenvy/views/UserInterface.h b/Trenser.Zenvy/Trenser.Zenvy/views/UserInterface.h index c346301..6952830 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/views/UserInterface.h +++ b/Trenser.Zenvy/Trenser.Zenvy/views/UserInterface.h @@ -1,5 +1,10 @@ +/* + * File: UserInterface.h + * Description: Declaration of the UserInterface class and related functions. + * Author: Trenser + * Created: 02-Apr-2026 + */ #pragma once -#include #include #include "AdminMenu.h" #include "EmployeeMenu.h" @@ -14,27 +19,28 @@ class UserInterface { private: - std::shared_ptr m_controller; - std::shared_ptr m_employeeMenu; - std::shared_ptr m_adminMenu; - std::shared_ptr m_financeExecutiveMenu; - std::shared_ptr m_hrManagerMenu; - std::shared_ptr m_itExecutiveMenu; - std::shared_ptr m_talentExecutiveMenu; - std::shared_ptr m_teamExecutiveMenu; - std::shared_ptr m_teamLeadMenu; + ZenvyController* m_controller; + EmployeeMenu* m_employeeMenu; + AdminMenu* m_adminMenu; + FinanceExecutiveMenu* m_financeExecutiveMenu; + HRManagerMenu* m_hrManagerMenu; + ITExecutiveMenu* m_itExecutiveMenu; + TalentExecutiveMenu* m_talentExecutiveMenu; + TeamExecutiveMenu* m_teamExecutiveMenu; + TeamLeadMenu* m_teamLeadMenu; public: - UserInterface() : m_controller(std::make_shared()), - m_employeeMenu(std::make_shared()), - m_adminMenu(std::make_shared()), - m_financeExecutiveMenu(std::make_shared()), - m_hrManagerMenu(std::make_shared()), - m_itExecutiveMenu(std::make_shared()), - m_talentExecutiveMenu(std::make_shared()), - m_teamExecutiveMenu(std::make_shared()), - m_teamLeadMenu(std::make_shared()) {}; - void run(); - bool handleOperation(int choice); - void login(); -}; - + UserInterface() : + m_controller(new ZenvyController()), + m_employeeMenu(new EmployeeMenu()), + m_adminMenu(new AdminMenu()), + m_financeExecutiveMenu(new FinanceExecutiveMenu()), + m_hrManagerMenu(new HRManagerMenu()), + m_itExecutiveMenu(new ITExecutiveMenu()), + m_talentExecutiveMenu(new TalentExecutiveMenu()), + m_teamExecutiveMenu(new TeamExecutiveMenu()), + m_teamLeadMenu(new TeamLeadMenu()) {}; + void run(); + bool handleOperation(int choice); + void login(); + ~UserInterface(); +}; \ No newline at end of file