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> PAY001: Generate Invoice </UserStory>
<Changes>
1. Added Utility.h to project configuration for supporting invoice generation utilities.
2. Updated Invoice model to use string-based keys for parts mapping instead of integer keys.
3. Implemented PaymentManagementService::generateInvoice to aggregate labour cost, parts cost, and apply discounts.
4. Integrated invoice creation with Factory to instantiate Invoice objects and persist them into datastore.
5. Enhanced Enums with PaymentMode::NOTSET to handle default invoice state.
</Changes>
<Test>
Acceptance Criteria:
1. Invoice auto-generates for each service booking once jobs are completed.
2. Invoice shows a clear breakdown of charges including labour cost, parts cost, discount, and total amount.
Precondition:
1. Service booking exists with at least one service and required inventory items.
2. Datastore is available for storing invoices.
3. Payment mode and status enums are properly configured.
Steps:
1. Complete all jobs in a service booking.
- Verify that PaymentManagementService::generateInvoice is triggered.
2. Check datastore for newly created invoice.
- Verify that invoice contains booking ID, labour cost, parts cost, discount, and total amount.
3. Inspect invoice details.
- Verify that breakdown of charges is accurate and discount is applied correctly.
4. Confirm invoice status.
- Verify that invoice is created with PaymentMode::NOTSET and PaymentStatus::PENDING.
</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> PAY003: View Invoices </UserStory>
<Changes>
1. Added CustomerMenu::viewInvoices to fetch invoices via Controller and display them to the customer.
2. Implemented displayInvoices helper to show invoice details including booking, vehicle, technician, discount, total amount, invoice date, and payment status.
3. Enhanced invoice display to include a tabular breakdown of inventory items (ItemName, Quantity, Price) used in the service.
4. Updated ServiceBooking to store assigned technician as a const User* for richer technician details in invoice output.
</Changes>
<Test>
Acceptance Criteria:
1. Invoice details should show total cost and discounts.
2. Invoice details should show list of parts used.
Precondition:
1. Customer is logged into the system.
2. At least one invoice exists for the customer in the datastore.
3. Inventory items are linked to the invoice.
Steps:
1. Navigate to Customer menu and choose "View Invoices".
- Verify that the system lists invoice details including booking ID, vehicle info, technician, discount, total amount, invoice date, and payment status.
2. Check the parts list under each invoice.
- Verify that inventory items are displayed in tabular form with ItemName, Quantity, and Price.
3. Confirm that discounts and total cost are shown correctly.
</Test>
<Review>
Sreeja Reghukumar, please review
</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> PAY002: Complete Payments </UserStory>
<Changes>
1. Integrated Controller with PaymentManagementService to support payment completion workflow.
2. Implemented PaymentManagementService::completePayment with validation for invoice ID, payment mode, and status update.
3. Enhanced CustomerMenu with helper functions to display pending invoices in tabular format and allow index-based selection.
4. Added CustomerMenu::selectPaymentMode to capture payment mode choice (OFFLINE/ONLINE).
5. Updated CustomerMenu::completePayments to handle invoice selection, payment mode input, and trigger payment completion via Controller.
6. Implemented notification logic to send confirmation to customers upon successful payment.
</Changes>
<Test>
Acceptance Criteria:
1. Payment status marked completed.
2. Confirmation message shown.
3. Confirmation notification sent.
Precondition:
1. Customer is logged into the system.
2. At least one pending invoice exists for the customer.
3. Datastore is available for storing invoices and updating payment status.
Steps:
1. Navigate to Customer menu and choose "Complete Payments".
- Verify that the system lists pending invoices with tabular details.
2. Select an invoice by index.
- Verify that the chosen invoice is retrieved correctly.
3. Enter payment mode (OFFLINE/ONLINE).
- Verify that the selected mode is applied to the invoice.
4. Confirm payment completion.
- Verify that the invoice status changes to COMPLETED.
- Verify that a confirmation message is displayed.
- Verify that a notification is sent to the customer.
</Test>
<Review>
Sreeja Reghukumar, please review
</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> SER005: Update Service Status </UserStory>
<Changes>
1. Integrated Controller with ServiceManagementService to support job completion workflow.
2. Implemented ServiceManagementService::completeJob with validation for technician assignment, job existence, and status transition.
3. Enhanced TechnicianMenu with job selection helper to display assigned jobs, allow index-based selection, and handle invalid choices.
4. Updated TechnicianMenu::completeJob to mark job as completed via Controller and provide user feedback.
5. Added logic to check if all jobs in a booking are completed, triggering invoice generation and customer notification.
</Changes>
<Test>
Acceptance Criteria:
1. Status updates are visible to customers immediately after technician marks job as completed.
Precondition:
1. Technician is logged into the system.
2. At least one active job card is assigned to the technician.
3. Datastore contains valid service bookings linked to jobs.
Steps:
1. Navigate to Technician menu and choose "Complete Job".
- Verify that the system lists active jobs with index-based selection.
2. Select a job card by index.
- Verify that the job status changes from STARTED to COMPLETED.
3. Check customer view.
- Verify that the updated status is reflected in the customer’s booking history.
4. If all jobs in the booking are completed:
- Verify that an invoice is generated and a notification is sent to the customer.
</Test>
<Review>
Sreeja Reghukumar, please review
</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> SER004: View Service History </UserStory>
<Changes>
1. Added integration between Controller and ServiceManagementService to fetch service bookings by customer ID.
2. Enhanced ServiceBooking model to store technician as a User* instead of a string for richer details.
3. Implemented Controller::getServiceBookingsByUser to return a read-only map of bookings for safe access.
4. Updated CustomerMenu::viewServiceHistory to display bookings in tabular format with aligned columns.
5. Added condition check to show technician name if assigned, otherwise display "Not Assigned".
6. Included booking status and discount percentage in the service history output.
</Changes>
<Test>
Acceptance Criteria:
1. System should fetch real-time status.
2. Status should update automatically when technician changes it.
3. Customer should be able to view history.
Precondition:
1. Customer is logged into the console application.
2. At least one active service booking exists for the customer.
3. Technician has permission to update booking status.
Steps:
1. Navigate to Customer menu and choose "View Service History".
- Verify that the console displays current booking status along with technician assignment.
2. Technician updates the status of a booking.
- Verify that the console view reflects the updated status automatically.
3. Customer views service history again.
- Verify that the history shows the latest status changes.
</Test>
<Review>
Sreeja Reghukumar, please review
</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> SER003: Remove Service </UserStory>
<Changes>
1. Added integration between Controller and ServiceManagementService to support service removal.
2. Implemented ServiceManagementService::removeService with validation for service existence and marking as INACTIVE.
3. Enhanced Controller::getServices to return a read-only map of services for safe UI access.
4. Added AdminMenu::selectServicesToRemove helper to list active services in tabular format and capture user choice.
5. Updated AdminMenu::removeService to prompt for service selection, delegate removal to Controller, and display success/failure messages.
</Changes>
<Test>
Acceptance Criteria:
1. Admin selects service ID.
2. System confirms deletion.
3. Service removed from customer menu.
Precondition:
1. Admin is logged into the system.
2. At least one active service exists in the datastore.
3. Customer menu displays available services.
Steps:
1. Navigate to Admin menu and choose "Remove Service".
- Verify that the system lists active services in tabular format.
2. Select a service ID from the list.
- Verify that the system confirms deletion.
3. Check customer menu.
- Verify that the removed service no longer appears.
</Test>
<Review>
Sreeja Reghukumar, please review
</Review>