Changes:
- Added missing include for MenuHelper.h in project and AdminMenu
- Fixed typo in variable name inventoryIems to inventoryItems in Controller.cpp
- Removed stray semicolon from include in Controller.h
- Cleaned up duplicate comments in Controller.cpp description header
- Minor formatting adjustments with blank lines after headers in multiple files
- Updated ServiceManagementService notification message to remove informal wording
- Refactored AdminMenu::changePassword to use changePasswordHelper
- Added util::clear() call at start of viewStockLevels
- Removed redundant helper functions from AdminMenu.cpp and moved to shared helpers
- Fixed bug in removeInventoryItem to use activeItems instead of inventoryItems
- Enhanced createComboPackages to enforce selection of two distinct services
- General comment cleanup and formatting consistency across headers and implementation files
**Customer Management**
* **CUS001 - Login:** Allows customers to securely log in using valid username and password.
* **CUS002 - Logout:** Allows customers to safely log out of the system.
* **CUS003 - Change Password:** Allows customers to update their account password for security.
* **CUS004 - Customer Registration:** Allows new customers to create an account by entering personal and vehicle details.
* **CUS005 - Update Customer Details:** Allows customers to modify their saved personal information.
* **CUS006 - Select Individual Service:** Allows customers to choose and book a single vehicle service.
* **CUS007 - Select Combo Package:** Allows customers to choose and book a combo package with multiple services.
**Notification Management**
* **NOT001 - View Customer Notifications:** Allows customers to view and manage their notifications for important updates.
* **NOT002 - View Admin Notifications:** Allows admins to view and manage their notifications for important updates.
* **NOT003 - View Technician Notifications:** Allows technicians to view and manage their notifications for important updates.
* **NOT004 - Low Stock Alert:** Sends notifications to admins when inventory stock falls below the threshold.
* **NOT005 - Payment Reminder:** Sends payment reminder notifications to customers for unpaid invoices.
* **NOT006 - Configure Notifications:** Allows customers to manage notification preferences for selected services.
**File Management**
* **File Management:** Handles file-related operations such as storing, retrieving, updating, and managing files within the system.
Related work items: #1551, #1561, #1563, #1564, #1568, #1569, #1570, #1571, #1572, #1592, #1593, #1594, #1595, #1596, #1597, #1624, #1626, #1648, #1649, #1708, #1709
Changes:
- Added name parameter to createTechnician for consistency
- Added function headers for notification-related methods in InventoryManagementService
- Used variables for notification title and message instead of passing strings directly
- Fixed payment reminder notification message formatting
- Moved common helper functions to MenuHelper.h
- Updated CustomerMenu to use shared helper functions instead of duplicate code
- Added missing includes in MenuHelper.h
- Removed redundant helper code from CustomerMenu.cpp
- Minor formatting and comment cleanup
- Add serialize/deserialize support for core models
- Add file-based load/save functions in management services
- Introduce FileManager, Config, Utility and helper utilities
- Persist observer IDs for notification services
- Resolve object relationships during load (services, bookings, invoices, job cards)
- Add controller-level loadSystemData/saveSystemData
- Load data at app startup and save on shutdown
<UserStory> NOT001: View Customer Notifications </UserStory>
<Changes>
1. Added shared notification helper functions to display notifications in tabular format, support notification selection, and show full notification details.
2. Implemented notification deletion logic in Controller and UserManagementService to remove notifications for the authenticated user after viewing.
3. Updated CustomerMenu::viewNotifications() to use the shared notification viewing and deletion flow.
</Changes>
<Test>
Precondition:
1. Customer is registered in the system.
2. Customer is logged into the system.
3. Customer has one or more notifications available.
Steps:
1. Navigate to “View Notifications” from the customer menu.
- Verify that the system displays the list of notifications with title and timestamp.
2. Select a notification from the displayed list.
- Verify that the system displays the full notification details including message.
3. View the selected notification and continue.
- Verify that the viewed notification is deleted from the system.
4. Navigate to “View Notifications” again.
- Verify that the previously viewed notification no longer appears in the notification list.
</Test>
<Review>
Sreeja Reghukumar, please review
</Review>
<UserStory> ADM005: Change Password </UserStory>
<Changes>
1. Added AuthenticationManagementService::changePassword to update the authenticated user’s password with validation.
2. Integrated Controller::changePassword to delegate password update requests to AuthenticationManagementService.
3. Enhanced AdminMenu::changePassword to prompt for new password, validate strength using Validator, and confirm update.
4. Added error handling to prevent password change when no user is logged in.
5. Provided user feedback messages for invalid password attempts and successful updates.
</Changes>
<Test>
Precondition:
1. Admin is logged into the system.
2. AuthenticationManagementService maintains active session.
3. Validator is available for password strength checks.
Steps:
1. Navigate to Admin Menu and select "Change Password".
2. Enter old password incorrectly.
- Verify that system rejects the attempt and displays error.
3. Enter new password that fails validation (length/complexity).
- Verify that system rejects with "Error: Password is not strong enough!".
4. Enter valid old password and strong new password.
- Verify that system confirms "Password changed successfully" and updates the user’s password.
</Test>
<Review>
Sreeja Reghukumar
</Review>
<UserStory> ADM003: Login </UserStory>
<Changes>
1. Added credential input handling in UserInterface::login with username and password prompts.
2. Integrated Controller::login to validate credentials and retrieve authenticated user.
3. Implemented role-based menu navigation: Admin → AdminMenu, Technician → TechnicianMenu, Customer → CustomerMenu.
4. Added error handling for invalid credentials and unknown user types with clear feedback messages.
5. Included util::clear for screen refresh and structured output formatting during login.
</Changes>
<Test>
Precondition:
1. Valid user accounts exist in the system (Admin, Technician, Customer).
2. Controller is connected to UserManagementService for authentication.
3. UserInterface is initialized with role-specific menus.
Steps:
1. Launch UserInterface and select "Login".
2. Enter incorrect username or password.
- Verify that system displays "Error: Invalid Username or Password".
3. Enter valid admin credentials.
- Verify that AdminMenu is displayed successfully.
4. Enter valid technician or customer credentials.
- Verify that TechnicianMenu or CustomerMenu is displayed accordingly.
</Test>
<Review>
Sreeja Reghukumar
</Review>
<UserStory> ADM002: Remove Technician or Customer </UserStory>
<Changes>
1. Integrated UserManagementService and ServiceManagementService into Controller for user removal operations.
2. Added Controller::removeUser to validate user existence, cancel related service bookings and technician jobs, and mark user inactive.
3. Updated JobCard and ServiceBooking models to use util::ServiceJobStatus consistently and store technician references as User* instead of strings.
4. Extended util::ServiceJobStatus enum with PENDING and CANCELLED states, including string conversion support.
5. Implemented ServiceManagementService methods to cancel customer service bookings and technician jobs, with inventory restocking and notifications.
6. Enhanced AdminMenu::removeUser to list active users, validate index input, confirm deletion, and invoke Controller::removeUser.
7. Added helper functions in AdminMenu to filter active users and display them with formatted output including user type.
</Changes>
<Test>
Precondition:
1. Admin is logged into the system.
2. Technician accounts exist in the system.
3. Technician has active job assignments.
Steps:
1. Navigate to Admin Menu and select "Remove User".
2. System displays list of active users with IDs, usernames, and user types.
- Verify that inactive users are excluded from the list.
3. Admin selects technician ID for removal.
- Verify that system confirms deletion before proceeding.
4. Technician is removed from job assignment list.
- Verify that associated jobs are cancelled, inventory is restocked, and notifications are sent.
</Test>
<Review>
Sreeja Reghukumar
</Review>
<UserStory> ADM001: Add Technician </UserStory>
<Changes>
1. Added UserManagementService integration in Controller to support technician account creation.
2. Updated Controller::createTechnician method to call createUser with util::UserType::TECHNICIAN.
3. Renamed parameter from 'phone' to 'phoneNumber' for clarity and consistency.
4. Enhanced AdminMenu::addTechnician with input validation for password, email, and phone number.
5. Added success and error handling messages in AdminMenu for technician creation workflow.
</Changes>
<Test>
Precondition:
1. Admin is logged into the system.
2. UserManagementService is available and connected.
3. No existing technician account with the same username/email.
Steps:
1. Navigate to Admin Menu and select "Add Technician".
2. Enter technician details (username, password, email, phone number).
- Verify that invalid password/email/phone inputs are rejected with error messages.
3. Enter valid technician details.
- Verify that uniqueness is checked and duplicate accounts are not created.
4. Submit valid details.
- Verify that technician account is created successfully and confirmation message is displayed.
</Test>
<Review>
Sreeja Reghukumar
</Review>
<UserStory> INV004: Check Availability Status </UserStory>
<Changes>
1. Updated Controller to delegate getInventoryItem calls to InventoryManagementService.
2. Implemented InventoryManagementService::getInventoryItem to fetch items from datastore by ID.
3. Enhanced AdminMenu with checkStockAvailability function:
- Accepts part ID as input.
- Retrieves item details from Controller.
- Displays item information (ID, part name, quantity) if found and active.
- Handles inactive or missing items gracefully.
</Changes>
<Test>
Precondition:
1. Admin user is logged into the system.
2. Inventory contains multiple items with unique IDs.
3. DataStore is initialized and accessible.
Steps:
1. Navigate to Admin Menu and select "Check Stock Availability".
- Verify that the system prompts for an Item ID.
2. Enter a valid Item ID for an active item.
- Verify that the system displays the item’s details including current quantity.
3. Enter an Item ID that does not exist.
- Verify that the system displays “Item not found”.
4. Enter an Item ID for an inactive item.
- Verify that the system does not display details and indicates the item is inactive.
</Test>
<Review>
Sreeja Reghukumar
</Review>
<UserStory> INV003: Remove Stock </UserStory>
<Changes>
1. Integrated InventoryManagementService into Controller to handle removal of inventory items.
2. Implemented InventoryManagementService::removeInventoryItem to mark items as INACTIVE in the datastore.
3. Enhanced AdminMenu with removeInventoryItem workflow:
- Displays inventory list with index, ID, part name, quantity, and price.
- Allows admin to select item by index for removal.
- Provides confirmation message after successful deletion.
4. Added static helper function displayInventoryWithItems in AdminMenu for modularized inventory display.
</Changes>
<Test>
Precondition:
1. Admin user is logged into the system.
2. Inventory contains multiple items with unique IDs.
3. DataStore is initialized and accessible.
Steps:
1. Navigate to Admin Menu and select "Remove Inventory Item".
- Verify that the system displays all inventory items with ID, part name, quantity, and price.
2. Select an item by entering its index.
- Verify that the system removes the item and displays a confirmation message.
3. Attempt to remove an item with an invalid index.
- Verify that the system rejects the input and shows an error message.
4. Navigate to "View Stock Levels".
- Verify that the removed item no longer appears in the inventory list.
</Test>
<Review>
Sreeja Reghukumar
</Review>
<UserStory> INV002: Add Stock </UserStory>
<Changes>
1. Added Controller integration with InventoryManagementService to support adding new inventory items and updating existing stock quantities.
2. Implemented InventoryManagementService::addInventoryItem to create new items via Factory and insert them into the DataStore.
3. Implemented InventoryManagementService::addInventoryItemStock to update stock quantities for existing items.
4. Enhanced AdminMenu with options to add new items or update stock quantities, including input validation and confirmation messages.
5. Added helper functions in AdminMenu to display inventory items and handle quantity updates interactively.
6. Included necessary headers (InventoryItem, Factory, iomanip) for new functionality.
</Changes>
<Test>
Precondition:
1. Admin user is logged into the system.
2. Inventory contains existing items with unique IDs.
3. DataStore is accessible and initialized.
Steps:
1. Navigate to Admin Menu and select "Add Inventory Item".
- Verify that the system prompts for part name, quantity, and price.
2. Enter details for a new item with a unique part name and ID.
- Verify that the item is successfully added and a confirmation message is displayed.
3. Attempt to add an item with a duplicate ID.
- Verify that the system rejects the duplicate and displays an error message.
4. Select "Add Quantity" option for an existing item.
- Verify that the system updates the stock quantity and displays the new total in the confirmation message.
5. Navigate to "View Stock Levels".
- Verify that the updated stock quantity is reflected in the inventory list.
</Test>
<Review>
Sreeja Reghukumar
</Review>
<UserStory> INV001: View Stock Level </UserStory>
<Changes>
1. Integrated InventoryManagementService into Controller to provide read-only access to inventory items.
2. Added implementation for InventoryManagementService::getInventoryItems to fetch data from DataStore.
3. Enhanced AdminMenu with viewStockLevels functionality to display inventory details (ID, part name, quantity, price).
4. Updated NotificationManagementService interface to provide concrete implementations for sendNotification, attach, detach, and notify methods.
5. Included necessary headers (InventoryItem, InventoryManagementService, iomanip) for new functionality.
</Changes>
<Test>
Precondition:
1. Admin user is logged into the system.
2. Inventory contains multiple items with varying stock levels.
3. Notification service is active and users are registered.
Steps:
1. Navigate to Admin Menu and select "View Stock Levels".
- Verify that the system displays all inventory items with ID, part name, quantity, and price.
2. Check items with sufficient stock.
- Verify that they are displayed normally without highlighting.
3. Check items with low stock threshold.
- Verify that these items are highlighted to indicate low availability.
4. Trigger a notification for a low-stock item.
- Verify that the notification is sent to registered users successfully.
</Test>
<Review>
Sreeja Reghukumar
</Review>
<UserStory> ADM006:Create Combo Package </UserStory>
<Changes>
1. Added ServiceManagementService::createComboPackage to validate package name, included services, and discount percentage before creation.
2. Integrated Controller::createComboPackage to delegate combo package creation to ServiceManagementService.
3. Enhanced AdminMenu::createComboPackages to allow admin input for package name, service selection, and discount percentage.
4. Implemented service validation to ensure only active services are selectable and that duplicate combos are prevented.
5. Added formatted output for service listing with cost calculation and confirmation messages upon successful package creation.
</Changes>
<Test>
Precondition:
1. Admin is logged into the system.
2. At least two active services exist in the system.
3. ServiceManagementService is connected to DataStore for services and combo packages.
Steps:
1. Navigate to Admin Menu and select "Create Combo Package".
2. Enter package name, select two active services, and provide discount percentage.
- Verify that system validates service IDs and ensures discount is between 0 and 100.
3. Attempt to create a package with invalid service IDs or duplicate services.
- Verify that system rejects with appropriate error messages.
4. Enter valid package details.
- Verify that combo package is saved successfully and visible to customers.
</Test>
<Review>
Sreeja Reghukumar
</Review>
<UserStory> SER003: Remove Combo Package </UserStory>
<Changes>
Added integration between Controller and ServiceManagementService to support combo package removal.
Implemented ServiceManagementService::removeComboPackage with validation for package ID and marking state as INACTIVE.
Enhanced AdminMenu with displayComboPackagesWithIndex helper to show packages in tabular format with index.
Updated AdminMenu::selectComboPackage to allow selection of active packages only and return selected package ID.
Updated AdminMenu::removeComboPackage to prompt for selection, confirm removal, and provide success/failure feedback.
</Changes>
<Test>
Acceptance Criteria:
Admin selects package ID.
System confirms deletion.
Package removed from customer menu.
Precondition:
Admin is logged into the system.
At least one active combo package exists.
Datastore is available for storing combo packages.
Steps:
Navigate to Admin menu and choose "Remove Combo Package".
Verify that the system displays available active packages in tabular format with index.
Select a package ID from the list.
Verify that inactive packages are skipped and only active ones are selectable.
Confirm removal.
Verify that the package is marked INACTIVE and removed from customer menu.
Check customer view.
Verify that the removed package is no longer visible to customers.
</Test>
<Review>
Sreeja Reghukumar, please review
</Review>
<UserStory>
NOT005: Payment Reminder
</UserStory>
<Changes>
1. Added payment reminder check in Controller::runSystemChecks() to trigger reminder processing during system startup.
2. Implemented PaymentManagementService::sendPaymentReminders() to identify unpaid invoices that exceed the pending payment threshold and send reminder notifications to customers.
3. Added reminder notification logic to include invoice details and stop reminders once invoice payment status changes from Pending to Paid.
</Changes>
<Test>
Precondition:
1. Customer has an invoice with PaymentStatus::PENDING.
2. Invoice age exceeds the configured payment reminder threshold.
3. Application is started and system checks execute.
Steps:
1. Start the application.
2. Allow system checks to run during startup.
3. Navigate to View Notifications.
- Verify that a payment reminder notification is displayed.
4. Open the generated notification.
- Verify that the notification includes the invoice ID and due date.
5. Complete payment for the invoice and restart the application.
- Verify that no further reminder notifications are generated for the paid invoice.
</Test>
<Review>
Sreeja Reghukumar, please review
</Review>
<UserStory> NOT004: Low Stock Alert </UserStory>
<Changes>
1. Added low stock alert check in Controller::runSystemChecks() to trigger inventory notification processing during system startup.
2. Implemented InventoryManagementService::sendLowStockAlerts() to detect inventory items below threshold, identify admin users, and send low stock alert notifications with item details.
3. Added helper logic to notify all admins when low stock inventory is detected.
</Changes>
<Test>
Precondition:
1. System has at least one admin user.
2. Inventory item exists with quantity below the configured low stock threshold.
3. Application is started and system checks execute.
Steps:
1. Start the application.
2. Allow system checks to run during startup.
3. Navigate to Inventory Menu / View Notifications.
- Verify that a low stock alert notification is displayed.
4. Open the generated notification.
- Verify that the notification includes the part name and remaining quantity.
5. Confirm notification content.
- Verify that the alert was triggered only for inventory items with stock below the threshold.
</Test>
<Review>
Sreeja Reghukumar, please review
</Review>
<UserStory> CUS001:Login </UserStory>
<Changes>
1. Added login implementation in AuthenticationManagementService to validate username and password from stored user records.
2. Connected Controller::login() with AuthenticationManagementService login logic.
3. Added getAuthenticatedUser() integration in Controller for retrieving the logged-in user.
4. Implemented login flow in UserInterface to collect credentials and validate login.
5. Added role-based menu navigation for Admin, Technician, and Customer after successful login.
6. Added error handling to display "Invalid Username or Password" for failed login attempts.
7. Added required includes and controller member dependency for authentication support.
8. Added a check to create a default admin automatically if no admin exists in the system on startup
</Changes>
<Test>
Login functionality validation
Precondition:
1. System is running.
2. User records are available in the data store.
3. Valid username and password exist for a registered user.
Steps:
1. Launch the application.
2. Select the login option from the main menu.
3. Enter a valid username and password.
- Verify that the entered credentials are validated.
- Verify that access is granted and the correct menu is shown based on user type.
4. Enter an invalid username or password.
- Verify that the message "Invalid Username or Password" is displayed.
</Test>
<Review>
Sreeja Reghukumar, please review
</Review>