Merge branch 'feature-notification-management-not006' into feature-notification-management
This commit is contained in:
@@ -69,6 +69,37 @@ void CustomerMenu::viewNotifications()
|
||||
viewAndDeleteNotification(m_controller);
|
||||
}
|
||||
|
||||
static bool getNotificationPreference(const std::string& serviceName)
|
||||
{
|
||||
int choice;
|
||||
while (true)
|
||||
{
|
||||
util::clear();
|
||||
std::cout << " Configure Notification Preferences\n";
|
||||
std::cout << "\n" << serviceName << " Notifications\n";
|
||||
std::cout << "1. Enable Notifications\n";
|
||||
std::cout << "2. Disable Notifications\n";
|
||||
std::cout << "Enter your choice: ";
|
||||
util::read(choice);
|
||||
if (choice == 1)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (choice == 2)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
std::cout << "\nInvalid choice. Please enter 1 or 2.\n";
|
||||
util::pressEnter();
|
||||
}
|
||||
}
|
||||
|
||||
void CustomerMenu::configureNotifications()
|
||||
{
|
||||
bool paymentServiceNotifications = getNotificationPreference("Payment Management Service");
|
||||
bool serviceManagementNotifications = getNotificationPreference("Service Management Service");
|
||||
m_controller.configureNotifications(paymentServiceNotifications, serviceManagementNotifications);
|
||||
util::clear();
|
||||
std::cout << "Notification preferences updated successfully.\n";
|
||||
util::pressEnter();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user