Implement Customer Menu

* Added Customer Menu display with all customer options
* Added menu choice handling using switch case
* Connected menu options to corresponding customer functions
* Added invalid choice message
* Added logout option handling
This commit is contained in:
2026-05-21 09:37:03 +05:30
parent 56c5c2dc70
commit be306781b1
@@ -4,31 +4,77 @@
void CustomerMenu::showMenu()
{
bool isMenuActive = true;
while (isMenuActive)
{
try
{
int choice;
util::clear();
std::cout << "" << std::endl;
util::read(choice);
if (!handleOperation(choice))
{
isMenuActive = false;
}
}
catch (const std::exception& e)
{
std::cout << "Exception: " << e.what() << std::endl;
util::pressEnter();
}
}
while (true)
{
try
{
int choice;
util::clear();
std::cout << "Customer Menu"
<< "\n1. Select a service"
<< "\n2. Select a combo package"
<< "\n3. Update Profile"
<< "\n4. Change Password"
<< "\n5. View Service History"
<< "\n6. Complete Payments"
<< "\n7. View Invoices"
<< "\n8. View Notifications"
<< "\n9. Configure Notifications"
<< "\n10. Logout"
<< "\nEnter a choice: ";
util::read(choice);
if (!handleOperation(choice))
{
break;
}
}
catch (const std::exception& e)
{
std::cout << "Exception: " << e.what() << std::endl;
util::pressEnter();
}
}
}
bool CustomerMenu::handleOperation(int choice)
{
return false;
switch (choice)
{
case 1:
selectService();
break;
case 2:
selectComboPackage();
break;
case 3:
updateDetails();
break;
case 4:
changePassword();
break;
case 5:
viewServiceHistory();
break;
case 6:
completePayments();
break;
case 7:
viewInvoices();
break;
case 8:
viewNotifications();
break;
case 9:
configureNotifications();
break;
case 10:
logout();
return false;
default:
std::cout << "Enter a valid choice!" << std::endl;
util::pressEnter();
}
return true;
}
void CustomerMenu::logout()
@@ -69,4 +115,4 @@ void CustomerMenu::viewNotifications()
void CustomerMenu::configureNotifications()
{
}
}