Setup basic UI and controller for authentication

<SRS> SRS01 : Authentication </SRS>

<Changes>
- Added basic UI structure with UserInterface and role-based menus (Admin, HR, IT, Finance, Talent, Team, TeamLead, Employee).
- Created menu classes for different roles, each with run() and handleOperation() methods.
</Changes>

<Review>
 Smitha Mohan
</Review>
This commit is contained in:
Tinu Johnson
2026-04-06 16:32:18 +05:30
parent f61d4259aa
commit 719bf5e7b3
17 changed files with 653 additions and 0 deletions
@@ -1 +1,52 @@
#include <iostream>
#include "AdminMenu.h"
#include"InputHelper.h"
#include"OutputHelper.h"
void AdminMenu::run()
{
bool isMenuActive = true;
while (isMenuActive)
{
try
{
int choice;
util::clear();
std::cout << "Zenvy - HR Management System\n1. Create HRManager\n2. Create Employee\n3. View Employee\n4. Deactivate Employee\n5. Logout\nEnter your Choice: ";
util::read(choice);
if (!handleOperation(choice))
{
isMenuActive = false;
}
}
catch (const std::exception& e)
{
std::cout << "Exception: " << e.what() << std::endl;
util::pressEnter();
}
}
}
bool AdminMenu::handleOperation(int choice)
{
switch (choice)
{
case 1:
m_zenvyController.createHRManager();
break;
case 2:
m_zenvyController.createEmployee();
break;
case 3:
m_zenvyController.viewEmployee();
break;
case 4:
m_zenvyController.deactivateEmployee();
break;
case 5:
return false;
default:
std::cout << "Enter a valid choice!" << std::endl;
}
return true;
}
@@ -1,5 +1,14 @@
#pragma once
#include<memory>
#include"ZenvyController.h"
class AdminMenu
{
private:
std::shared_ptr<ZenvyController> m_zenvyController;
public:
AdminMenu() :m_zenvyController(std::make_shared<ZenvyController>()) {};
void run();
bool handleOperation(int);
};
@@ -1 +1,79 @@
#include <iostream>
#include "EmployeeMenu.h"
#include"InputHelper.h"
#include"OutputHelper.h"
void EmployeeMenu::run()
{
bool isMenuActive = true;
while (isMenuActive)
{
try
{
int choice;
util::clear();
std::cout << "Zenvy - The HR Management System\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\n14. Logout\nEnter your Choice: ";
util::read(choice);
if (!handleOperation(choice))
{
isMenuActive = false;
}
}
catch (const std::exception& e)
{
std::cout << "Exception: " << e.what() << std::endl;
util::pressEnter();
}
}
}
bool EmployeeMenu::handleOperation(int choice)
{
switch (choice)
{
case 1:
m_zenvyController.applyLeave();
break;
case 2:
m_zenvyController.viewPayslip();
break;
case 3:
m_zenvyController.viewPayslipHistory();
break;
case 4 :
m_zenvyController.raiseTicket();
break;
case 5 :
m_zenvyController.viewTicket();
break;
case 6:
m_zenvyController.viewTicketHistory();
break;
case 7:
m_zenvyController.viewEmployees();
break;
case 8:
m_zenvyController.searchEmployee();
break;
case 9:
m_zenvyController.viewTeamMembers();
break;
case 10:
m_zenvyController.bookMeetingRoom();
break;
case 11:
m_zenvyController.viewBookingHistory();
break;
case 12:
m_zenvyController.viewNotifications();
break;
case 13:
m_zenvyController.viewAnnouncements();
break;
case 14:
return false;
default:
std::cout << "Enter a valid choice!" << std::endl;
}
return true;
}
@@ -1,5 +1,14 @@
#pragma once
#include<memory>
#include"ZenvyController.h"
class EmployeeMenu
{
private:
std::shared_ptr<ZenvyController> m_zenvyController;
public:
EmployeeMenu() : m_zenvyController(std::make_shared<ZenvyController>()) {};
void run();
bool handleOperation(int);
};
@@ -1 +1,70 @@
#include <iostream>
#include "FinanceExecutiveMenu.h"
#include"InputHelper.h"
#include"OutputHelper.h"
void FinanceExecutiveMenu::run()
{
bool isMenuActive = true;
while (isMenuActive)
{
try
{
int choice;
util::clear();
std::cout << "Zenvy - The HR Management System\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 Payslip\n10. Update Payroll\n11. Logout\nEnter your Choice: ";
util::read(choice);
if (!handleOperation(choice))
{
isMenuActive = false;
}
}
catch (const std::exception& e)
{
std::cout << "Exception: " << e.what() << std::endl;
util::pressEnter();
}
}
}
bool FinanceExecutiveMenu::handleOperation(int choice)
{
switch (choice)
{
case 1:
m_zenvyController.applyLeave();
break;
case 2:
m_zenvyController.viewPayslip();
break;
case 3:
m_zenvyController.viewPayslipHistory();
break;
case 4:
m_zenvyController.viewEmployees();
break;
case 5:
m_zenvyController.searchEmployee();
break;
case 6:
m_zenvyController.viewNotifications();
break;
case 7:
m_zenvyController.viewAnnouncements();
break;
case 8:
m_zenvyController.resolveTicket();
break;
case 9:
m_zenvyController.generatePayslip();
break;
case 10:
m_zenvyController.updatePayroll();
break;
case 11:
return false;
default:
std::cout << "Enter a valid choice!" << std::endl;
}
return true;
}
@@ -1,5 +1,14 @@
#pragma once
#include<memory>
#include"ZenvyController.h"
class FinanceExecutiveMenu
{
private:
std::shared_ptr<ZenvyController> m_zenvyController;
public:
FinanceExecutiveMenu() : m_zenvyController(std::make_shared<ZenvyController>()) {};
void run();
bool handleOperation(int);
};
@@ -1 +1,73 @@
#include <iostream>
#include "HRManagerMenu.h"
#include"InputHelper.h"
#include"OutputHelper.h"
void HRManagerMenu::run()
{
bool isMenuActive = true;
while (isMenuActive)
{
try
{
int choice;
util::clear();
std::cout << "Zenvy - The HR Management System\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. Register CandidateAsEmployee\n12. Logout\nEnter your Choice: ";
util::read(choice);
if (!handleOperation(choice))
{
isMenuActive = false;
}
}
catch (const std::exception& e)
{
std::cout << "Exception: " << e.what() << std::endl;
util::pressEnter();
}
}
}
bool HRManagerMenu::handleOperation(int choice)
{
switch (choice)
{
case 1:
m_zenvyController.applyLeave();
break;
case 2:
m_zenvyController.viewPayslip();
break;
case 3:
m_zenvyController.viewPayslipHistory();
break;
case 4:
m_zenvyController.viewEmployees();
break;
case 5:
m_zenvyController.searchEmployee();
break;
case 6:
m_zenvyController.viewNotifications();
break;
case 7:
m_zenvyController.viewAnnouncements();
break;
case 8:
m_zenvyController.createEmployee();
break;
case 9:
m_zenvyController.regularizeAttenance();
break;
case 10:
m_zenvyController.updateLeaveRequest();
break;
case 11:
m_zenvyController.registercandidateAsEmployee();
break;
case 12:
return false;
default:
std::cout << "Enter a valid choice!" << std::endl;
}
return true;
}
@@ -1,5 +1,14 @@
#pragma once
#include<memory>
#include"ZenvyController.h"
class HRManagerMenu
{
private:
std::shared_ptr<ZenvyController> m_zenvyController;
public:
HRManagerMenu() : m_zenvyController(std::make_shared<ZenvyController>()) {};
void run();
bool handleOperation(int);
};
@@ -1 +1,64 @@
#include <iostream>
#include "ITExecutiveMenu.h"
#include"InputHelper.h"
#include"OutputHelper.h"
void ITExecutiveMenu::run()
{
bool isMenuActive = true;
while (isMenuActive)
{
try
{
int choice;
util::clear();
std::cout << "Zenvy - The HR Management System\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. Logout\nEnter your Choice: ";
util::read(choice);
if (!handleOperation(choice))
{
isMenuActive = false;
}
}
catch (const std::exception& e)
{
std::cout << "Exception: " << e.what() << std::endl;
util::pressEnter();
}
}
}
bool ITExecutiveMenu::handleOperation(int choice)
{
switch (choice)
{
case 1:
m_zenvyController.applyLeave();
break;
case 2:
m_zenvyController.viewPayslip();
break;
case 3:
m_zenvyController.viewPayslipHistory();
break;
case 4:
m_zenvyController.viewEmployees();
break;
case 5:
m_zenvyController.searchEmployee();
break;
case 6:
m_zenvyController.viewNotifications();
break;
case 7:
m_zenvyController.viewAnnouncements();
break;
case 8:
m_zenvyController.resolveTicket();
break;
case 9:
return false;
default:
std::cout << "Enter a valid choice!" << std::endl;
}
return true;
}
@@ -1,5 +1,14 @@
#pragma once
#include<memory>
#include"ZenvyController.h"
class ITExecutiveMenu
{
private:
std::shared_ptr<ZenvyController> m_zenvyController;
public:
ITExecutiveMenu() : m_zenvyController(std::make_shared<ZenvyController>()) {};
void run();
bool handleOperation(int);
};
@@ -1 +1,76 @@
#include <iostream>
#include "TalentExecutiveMenu.h"
#include"InputHelper.h"
#include"OutputHelper.h"
void TalentExecutiveMenu::run()
{
bool isMenuActive = true;
while (isMenuActive)
{
try
{
int choice;
util::clear();
std::cout << "Zenvy - The HR Management System\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. Logout\nEnter your Choice: ";
util::read(choice);
if (!handleOperation(choice))
{
isMenuActive = false;
}
}
catch (const std::exception& e)
{
std::cout << "Exception: " << e.what() << std::endl;
util::pressEnter();
}
}
}
bool TalentExecutiveMenu::handleOperation(int choice)
{
switch (choice)
{
case 1:
m_zenvyController.applyLeave();
break;
case 2:
m_zenvyController.viewPayslip();
break;
case 3:
m_zenvyController.viewPayslipHistory();
break;
case 4:
m_zenvyController.viewEmployees();
break;
case 5:
m_zenvyController.searchEmployee();
break;
case 6:
m_zenvyController.viewNotifications();
break;
case 7:
m_zenvyController.viewAnnouncements();
break;
case 8:
m_zenvyController.createNewJob();
break;
case 9:
m_zenvyController.viewJobOpenings();
break;
case 10:
m_zenvyController.addCandidate();
break;
case 11:
m_zenvyController.updateCandidateStatus();
break;
case 12:
m_zenvyController.viewShortlistedCandidates();
break;
case 13:
return false;
default:
std::cout << "Enter a valid choice!" << std::endl;
}
return true;
}
@@ -1,5 +1,14 @@
#pragma once
#include<memory>
#include"ZenvyController.h"
class TalentExecutiveMenu
{
private:
std::shared_ptr<ZenvyController> m_zenvyController;
public:
TalentExecutiveMenu() : m_zenvyController(std::make_shared < ZenvyController>()) {};
void run();
bool handleOperation(int);
};
@@ -1 +1,79 @@
#include <iostream>
#include "TeamExecutiveMenu.h"
#include"InputHelper.h"
#include"OutputHelper.h"
void TeamExecutiveMenu::run()
{
bool isMenuActive = true;
while (isMenuActive)
{
try
{
int choice;
util::clear();
std::cout << "Zenvy - The HR Management System\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. Logout\nEnter your Choice: ";
util::read(choice);
if (!handleOperation(choice))
{
isMenuActive = false;
}
}
catch (const std::exception& e)
{
std::cout << "Exception: " << e.what() << std::endl;
util::pressEnter();
}
}
}
bool TeamExecutiveMenu::handleOperation(int choice)
{
switch (choice)
{
case 1:
m_zenvyController.applyLeave();
break;
case 2:
m_zenvyController.viewPayslip();
break;
case 3:
m_zenvyController.viewPayslipHistory();
break;
case 4:
m_zenvyController.viewEmployees();
break;
case 5:
m_zenvyController.searchEmployee();
break;
case 6:
m_zenvyController.viewNotifications();
break;
case 7:
m_zenvyController.viewAnnouncements();
break;
case 8:
m_zenvyController.createTeam();
break;
case 9:
m_zenvyController.updateTeam();
break;
case 10:
m_zenvyController.removeTeam();
break;
case 11:
m_zenvyController.assignEmployee();
break;
case 12:
m_zenvyController.unassignEmployee();
break;
case 13:
m_zenvyController.viewTeams();
break;
case 14:
return false;
default:
std::cout << "Enter a valid choice!" << std::endl;
}
return true;
}
@@ -1,5 +1,14 @@
#pragma once
#include<memory>
#include"ZenvyController.h"
class TeamExecutiveMenu
{
private:
std::shared_ptr<ZenvyController> m_zenvyController;
public:
TeamExecutiveMenu() : m_zenvyController(std::make_shared<ZenvyController>()) {};
void run();
bool handleOperation(int);
};
@@ -1 +1,85 @@
#include <iostream>
#include "TeamLeadMenu.h"
#include"InputHelper.h"
#include"OutputHelper.h"
void TeamLeadMenu::run()
{
bool isMenuActive = true;
while (isMenuActive)
{
try
{
int choice;
util::clear();
std::cout << "Zenvy - The HR Management System\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. Logout\nEnter your Choice: ";
util::read(choice);
if (!handleOperation(choice))
{
isMenuActive = false;
}
}
catch (const std::exception& e)
{
std::cout << "Exception: " << e.what() << std::endl;
util::pressEnter();
}
}
}
bool TeamLeadMenu::handleOperation(int choice)
{
switch (choice)
{
case 1:
m_zenvyController.applyLeave();
break;
case 2:
m_zenvyController.viewPayslip();
break;
case 3:
m_zenvyController.viewPayslipHistory();
break;
case 4:
m_zenvyController.raiseTicket();
break;
case 5:
m_zenvyController.viewTicket();
break;
case 6:
m_zenvyController.viewTicketHistory();
break;
case 7:
m_zenvyController.viewEmployees();
break;
case 8:
m_zenvyController.searchEmployee();
break;
case 9:
m_zenvyController.viewTeamMembers();
break;
case 10:
m_zenvyController.bookMeetingRoom();
break;
case 11:
m_zenvyController.viewBookingHistory();
break;
case 12:
m_zenvyController.viewNotifications();
break;
case 13:
m_zenvyController.viewAnnouncements();
break;
case 14:
m_zenvyController.regularizeAttendance();
break;
case 15:
m_zenvyController.updateLeaveRequest();
break;
case 16:
return false;
default:
std::cout << "Enter a valid choice!" << std::endl;
}
return true;
}
@@ -1,5 +1,14 @@
#pragma once
#include<memory>
#include"ZenvyController.h"
class TeamLeadMenu
{
private:
std::shared_ptr<ZenvyController> m_zenvyController;
public:
TeamLeadMenu() : m_zenvyController(std::make_shared<ZenvyController>()) {};
void run();
bool handleOperation(int);
};
@@ -1,4 +1,15 @@
#pragma once
#include <memory>
#include <utility>
#include "AdminMenu.h"
#include "EmployeeMenu.h"
#include "FinanceExecutiveMenu.h"
#include "HRManagerMenu.h"
#include "ITExecutiveMenu.h"
#include "TalentExecutiveMenu.h"
#include "TeamExecutiveMenu.h"
#include "TeamLeadMenu.h"
#include "ZenvyController.h"
class UserInterface
{