Implement Logout functionality

<UserStory> ADM004: Logout </UserStory>

<Changes>
    1. Added AuthenticationManagementService::logout to clear authenticated user session.
    2. Integrated logout handling in Controller::logout to delegate session termination.
    3. Updated AdminMenu::logout and TechnicianMenu::logout to call Controller::logout for consistent session management.
    4. Extended TechnicianMenu.h with logout method declaration.
    5. Ensured session termination returns control to main menu after logout.
</Changes>

<Test>

  Precondition:
  1. User is logged into the system (Admin or Technician).
  2. AuthenticationManagementService maintains active session.
  3. Controller is connected to AuthenticationManagementService.

  Steps:
  1. Navigate to Admin or Technician Menu.
  2. Select "Logout" option.
    - Verify that AuthenticationManagementService::logout clears authenticated user.
  3. Session is terminated.
    - Verify that system confirms logout and invalidates session.
  4. Console returns to main menu.
    - Verify that user is redirected to main menu and must log in again to continue.
</Test>

<Review>
Sreeja Reghukumar
</Review>
This commit is contained in:
Avinash Rajesh
2026-05-20 20:04:25 +05:30
parent 56c5c2dc70
commit df769a7528
6 changed files with 16 additions and 0 deletions
@@ -2,6 +2,7 @@
#include "Map.h"
#include <string>
#include "Enums.h"
#include "AuthenticationManagementService.h"
class Service;
class ComboPackage;
@@ -14,6 +15,8 @@ class Notification;
class Controller
{
private:
AuthenticationManagementService m_authenticationManagementService;
public:
bool login(const std::string& username, const std::string& password);
void logout();