diff --git a/Trenser.Zenvy/Trenser.Zenvy/Trenser.Zenvy.cpp b/Trenser.Zenvy/Trenser.Zenvy/Trenser.Zenvy.cpp index 4413069..64b1e4b 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/Trenser.Zenvy.cpp +++ b/Trenser.Zenvy/Trenser.Zenvy/Trenser.Zenvy.cpp @@ -1,4 +1,12 @@ +/* + * File: Trenser.Zenvy.cpp + * Description: Zenvy Main + * Author: Trenser + * Created: 30-Mar-2026 + */ + #include "UserInterface.h" + int main() { UserInterface userInterFace; diff --git a/Trenser.Zenvy/Trenser.Zenvy/services/ApplicationConfig.cpp b/Trenser.Zenvy/Trenser.Zenvy/services/ApplicationConfig.cpp index cb68b98..e5a0d0e 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/services/ApplicationConfig.cpp +++ b/Trenser.Zenvy/Trenser.Zenvy/services/ApplicationConfig.cpp @@ -1 +1,8 @@ +/* + * 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 8e4705e..bbeadd1 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/services/ApplicationConfig.h +++ b/Trenser.Zenvy/Trenser.Zenvy/services/ApplicationConfig.h @@ -1,3 +1,10 @@ +/* + * 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..2ab575a 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/services/AttendanceManagementService.cpp +++ b/Trenser.Zenvy/Trenser.Zenvy/services/AttendanceManagementService.cpp @@ -1 +1,8 @@ +/* + * 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..5f12270 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/services/AttendanceManagementService.h +++ b/Trenser.Zenvy/Trenser.Zenvy/services/AttendanceManagementService.h @@ -1,3 +1,10 @@ +/* + * 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 9d7fc4f..642c868 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/services/AuthenticationManagementService.cpp +++ b/Trenser.Zenvy/Trenser.Zenvy/services/AuthenticationManagementService.cpp @@ -1,65 +1,103 @@ +/* + * 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(); - Enums::LoginStatus loginStatus = Enums::LoginStatus::USER_NOT_FOUND; - Enums::EmployeeType employeeType = Enums::EmployeeType::INVALID; - Enums::EmployeeDesignation employeeDesignation = Enums::EmployeeDesignation::INVALID; - for (const auto& employee : employees) - { - if (employee.second->getEmployeeEmail() == email) - { - if (employee.second->getEmployeePassword() == password) - { - if (password == Config::Authentication::DEFAULT_PASSWORD) - { - loginStatus = Enums::LoginStatus::FIRST_LOGIN; - } - else - { - loginStatus = Enums::LoginStatus::SUCCESS; - } - employeeType = employee.second->getEmployeeType(); - if (employeeType == Enums::EmployeeType::GENERAL) - { - std::shared_ptr generalEmployee = std::dynamic_pointer_cast(employee.second); - if (generalEmployee) - { - employeeDesignation = generalEmployee->getDesignation(); - } - else - { - throw std::runtime_error("Invalid Employee Type"); - } - } - m_dataStore.setAuthenticatedEmployee(employee.second); - } - else - { - loginStatus = Enums::LoginStatus::INVALID_PASSWORD; - } - break; - } - } - return std::make_tuple(loginStatus, employeeType, employeeDesignation); + employeeMap& employees = m_dataStore.getEmployees(); + Enums::LoginStatus loginStatus = Enums::LoginStatus::USER_NOT_FOUND; + Enums::EmployeeType employeeType = Enums::EmployeeType::INVALID; + Enums::EmployeeDesignation employeeDesignation = Enums::EmployeeDesignation::INVALID; + for (const auto& employee : employees) + { + if (employee.second->getEmployeeEmail() == email) + { + if (employee.second->getEmployeePassword() == password) + { + if (password == Config::Authentication::DEFAULT_PASSWORD) + { + loginStatus = Enums::LoginStatus::FIRST_LOGIN; + } + else + { + loginStatus = Enums::LoginStatus::SUCCESS; + } + employeeType = employee.second->getEmployeeType(); + if (employeeType == Enums::EmployeeType::GENERAL) + { + std::shared_ptr generalEmployee = std::dynamic_pointer_cast(employee.second); + if (generalEmployee) + { + employeeDesignation = generalEmployee->getDesignation(); + } + else + { + throw std::runtime_error("Invalid Employee Type"); + } + } + m_dataStore.setAuthenticatedEmployee(employee.second); + } + else + { + loginStatus = Enums::LoginStatus::INVALID_PASSWORD; + } + break; + } + } + 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.getAuthenticatedUser(); - if (authenticatedUser) - { - authenticatedUser->setEmployeePassword(password); - } - else - { - throw std::runtime_error("User not found"); - } + std::shared_ptr authenticatedUser = m_dataStore.getAuthenticatedUser(); + 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.getAuthenticatedUser()) { m_dataStore.getAuthenticatedUser() = nullptr; diff --git a/Trenser.Zenvy/Trenser.Zenvy/services/AuthenticationManagementService.h b/Trenser.Zenvy/Trenser.Zenvy/services/AuthenticationManagementService.h index f838311..392065b 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/services/AuthenticationManagementService.h +++ b/Trenser.Zenvy/Trenser.Zenvy/services/AuthenticationManagementService.h @@ -1,3 +1,10 @@ +/* + * File: AuthenticationManagementService.h + * Description: Handles authentication related operations + * Author: Trenser + * Created: 30-Mar-2026 + */ + #pragma once #include #include @@ -19,4 +26,3 @@ public: void logout(); void changePassword(const std::string&); }; - diff --git a/Trenser.Zenvy/Trenser.Zenvy/services/BookingManagementService.cpp b/Trenser.Zenvy/Trenser.Zenvy/services/BookingManagementService.cpp index db5a4c9..cb032c3 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/services/BookingManagementService.cpp +++ b/Trenser.Zenvy/Trenser.Zenvy/services/BookingManagementService.cpp @@ -1 +1,8 @@ +/* + * 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..7f343a4 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/services/BookingManagementService.h +++ b/Trenser.Zenvy/Trenser.Zenvy/services/BookingManagementService.h @@ -1,3 +1,10 @@ +/* + * 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/EmployeeManagememtService.cpp b/Trenser.Zenvy/Trenser.Zenvy/services/EmployeeManagememtService.cpp index bf8ad9d..5fdebfe 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/services/EmployeeManagememtService.cpp +++ b/Trenser.Zenvy/Trenser.Zenvy/services/EmployeeManagememtService.cpp @@ -1 +1,8 @@ +/* + * File: EmployeeManagementService.cpp + * Description: Handle operations related to employees + * Author: Trenser + * Created: 30-Mar-2026 + */ + #include "EmployeeManagememtService.h" diff --git a/Trenser.Zenvy/Trenser.Zenvy/services/EmployeeManagememtService.h b/Trenser.Zenvy/Trenser.Zenvy/services/EmployeeManagememtService.h index 05e6ca7..3bb2294 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/services/EmployeeManagememtService.h +++ b/Trenser.Zenvy/Trenser.Zenvy/services/EmployeeManagememtService.h @@ -1,3 +1,10 @@ +/* + * File: EmployeeManagementService.h + * Description: Handle operations related to employees + * Author: Trenser + * Created: 30-Mar-2026 + */ + #pragma once class EmployeeManagememtService { diff --git a/Trenser.Zenvy/Trenser.Zenvy/services/LeaveManagementService.cpp b/Trenser.Zenvy/Trenser.Zenvy/services/LeaveManagementService.cpp index a40f268..733f9eb 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/services/LeaveManagementService.cpp +++ b/Trenser.Zenvy/Trenser.Zenvy/services/LeaveManagementService.cpp @@ -1 +1,8 @@ +/* + * 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..1010ec4 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/services/LeaveManagementService.h +++ b/Trenser.Zenvy/Trenser.Zenvy/services/LeaveManagementService.h @@ -1,3 +1,10 @@ +/* + * 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..3e77020 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/services/LogService.cpp +++ b/Trenser.Zenvy/Trenser.Zenvy/services/LogService.cpp @@ -1,3 +1,10 @@ +/* + * File: Log.cpp + * Description: Handle operations related to logging + * Author: Trenser + * Created: 01-Apr-2026 + */ + #include "LogService.h" #include "Log.h" #include "Factory.h" diff --git a/Trenser.Zenvy/Trenser.Zenvy/services/LogService.h b/Trenser.Zenvy/Trenser.Zenvy/services/LogService.h index 6918b25..c1cf644 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/services/LogService.h +++ b/Trenser.Zenvy/Trenser.Zenvy/services/LogService.h @@ -1,3 +1,10 @@ +/* + * File: Log.h + * Description: Handle operations related to logging + * Author: Trenser + * Created: 01-Apr-2026 + */ + #pragma once #include "Log.h" diff --git a/Trenser.Zenvy/Trenser.Zenvy/services/NotificationManagementService.cpp b/Trenser.Zenvy/Trenser.Zenvy/services/NotificationManagementService.cpp index cc23059..7eaa377 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/services/NotificationManagementService.cpp +++ b/Trenser.Zenvy/Trenser.Zenvy/services/NotificationManagementService.cpp @@ -1 +1,8 @@ +/* + * 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..6b4aba1 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/services/NotificationManagementService.h +++ b/Trenser.Zenvy/Trenser.Zenvy/services/NotificationManagementService.h @@ -1,5 +1,11 @@ +/* + * 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 154cf1f..57ca929 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/services/PayslipManagementService.cpp +++ b/Trenser.Zenvy/Trenser.Zenvy/services/PayslipManagementService.cpp @@ -1 +1,8 @@ +/* + * File: PayslipManagementService.cpp + * Description: Handle operations related to employee payslips + * Author: Trenser + * Created: 30-Mar-2026 + */ + #include "PayslipManagementService.h" diff --git a/Trenser.Zenvy/Trenser.Zenvy/services/PayslipManagementService.h b/Trenser.Zenvy/Trenser.Zenvy/services/PayslipManagementService.h index 04c9805..7f43806 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/services/PayslipManagementService.h +++ b/Trenser.Zenvy/Trenser.Zenvy/services/PayslipManagementService.h @@ -1,3 +1,10 @@ +/* + * File: PayslipManagementService.h + * Description: Handle operations related to employee payslips + * Author: Trenser + * Created: 30-Mar-2026 + */ + #pragma once class PayslipManagementService { diff --git a/Trenser.Zenvy/Trenser.Zenvy/services/TalentAcquisitionManagementService.cpp b/Trenser.Zenvy/Trenser.Zenvy/services/TalentAcquisitionManagementService.cpp index 5fd0d2d..9e0ef96 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/services/TalentAcquisitionManagementService.cpp +++ b/Trenser.Zenvy/Trenser.Zenvy/services/TalentAcquisitionManagementService.cpp @@ -1 +1,8 @@ +/* + * 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..ed0dd32 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/services/TalentAcquisitionManagementService.h +++ b/Trenser.Zenvy/Trenser.Zenvy/services/TalentAcquisitionManagementService.h @@ -1,5 +1,11 @@ +/* + * 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..8b13b81 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/services/TeamManagementService.cpp +++ b/Trenser.Zenvy/Trenser.Zenvy/services/TeamManagementService.cpp @@ -1 +1,8 @@ +/* + * 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..21275da 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/services/TeamManagementService.h +++ b/Trenser.Zenvy/Trenser.Zenvy/services/TeamManagementService.h @@ -1,3 +1,10 @@ +/* + * 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..bc995f9 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/services/TicketManagementService.cpp +++ b/Trenser.Zenvy/Trenser.Zenvy/services/TicketManagementService.cpp @@ -1 +1,8 @@ +/* + * 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..8a38d98 100644 --- a/Trenser.Zenvy/Trenser.Zenvy/services/TicketManagementService.h +++ b/Trenser.Zenvy/Trenser.Zenvy/services/TicketManagementService.h @@ -1,3 +1,10 @@ +/* + * File: TicketManagementService.h + * Description: Handle operations related to Ticket Management + * Author: Trenser + * Created: 30-Mar-2026 + */ + #pragma once class TicketManagementService {