<UserStory> NOT006: Configure Notifications </UserStory>
<Changes>
1. Added notification subscription configuration in CustomerMenu to allow customers to enable or disable notifications for Payment Management Service and Service Management Service.
2. Updated Controller::configureNotifications() to attach or detach the authenticated user from service observers based on selected notification preferences.
3. Refactored Observer interface and User notification handling to support notification delivery through observer subscriptions.
4. Implemented observer attach, detach, and sendNotification logic in InventoryManagementService, PaymentManagementService, and ServiceManagementService to ensure notifications are sent only to subscribed users.
</Changes>
<Test>
Precondition:
1. Customer user is logged into the system.
2. Notification configuration option is available in Customer Menu.
3. Notification-triggering event exists for Payment Management Service or Service Management Service.
Steps:
1. Navigate to Configure Notification Preferences in Customer Menu.
2. Enable notifications for one service and disable notifications for the other.
3. Trigger a notification event for both services.
- Verify that notification is received only from the subscribed service.
4. Change preferences by disabling the subscribed service and enabling the other.
5. Trigger notification events again.
- Verify that notification is received only from the newly subscribed service.
</Test>
<Review>
Sreeja Reghukumar, please review
</Review>
- Removed observer map from Subject base class
- Removed notify() from Subject interface
- Made NotificationManagementService abstract with pure virtual methods
- Added static observer maps to notification service implementations
- Added attach() and detach() overrides in inventory, payment, and service management services
- Added update() override in User model for observer pattern support
- Updated notification method declarations with override specifiers
<Changes>
1. Added State enum with ACTIVE and INACTIVE values in Enums.h.
2. Added state member, getter, and setter in User, Service, InventoryItem, and ComboPackage models.
3. Updated constructors to initialize model objects with ACTIVE state by default.
4. Added state string conversion helper functions in Enums.h.
5. Added default return values in Controller getter methods to complete stub implementations.
6. Added basic menu loop implementation in CustomerMenu and TechnicianMenu for handling user input.
</Changes>
Changes:
- Added stub implementations for Controller.cpp methods
- Fixed const issue in UserInterface methods (run, login, registerCustomer, handleOperation)
- Changed return types to use const pointers for read-only objects
- Updated maps and vectors to return const object pointers
- Fixed some function parameter names and signatures for consistency