- Corrected inconsistent status label formatting: replaced "Inprogress" with "In Progress" in TechnicianMenu and MenuHelper.
- Updated headings in selectJobCardToUpdate to clearer phrasing:
- "Select a job to mark as In Progress"
- "Select a job to mark as Completed".
- Added spacing before and after the "No jobs available" message to improve readability and provide clear separation from headings.
- Replaced duplicated prompt "Select the Job Card to Update (Index):" with concise "Enter the job index to update:".
- Improved TechnicianMenu option display to show "In Progress" instead of "Inprogress".
Fixes#1808
<User Story> Complete Payments - 1797</User Story>
<Changes>
1. Added Controller::getAllInvoices
- Retrieves all invoices from PaymentManagementService and returns them as a read-only map.
2. Implemented Controller::confirmPayment
- Delegates payment confirmation for a given invoice ID to PaymentManagementService.
3. Introduced PaymentManagementService::getAllInvoice
- Provides access to all invoices stored in the datastore.
4. Added PaymentManagementService::confirmPayment
- Confirms payment for a specific invoice, updates payment date and status, and sends notification.
5. Extended util::PaymentStatus enum
- Added PAID status and updated string conversion.
6. Integrated AdminMenu::confirmPayment
- Validates invoice list, filters by status, allows selection, and confirms payment.
7. Updated CustomerMenu::completePayments
- Uses parameterized status filtering for invoice selection.
8. Enhanced MenuHelper::selectInvoiceFromUserForPayment
- Accepts requiredStatus parameter for flexible filtering.
9. Adjusted AdminMenu options
- Added "Confirm Payment" before Logout.
</Changes>
<Test>
Acceptance Criteria:
1. Admin selects "Confirm Payment" from menu.
- Verify system prompts and displays invoices filtered by status.
2. Admin selects invoice with status = PAID.
- Verify payment confirmation updates date, sets status, and sends notification.
3. Admin attempts confirmation with empty invoice list.
- Verify error message: "No pending invoices available for confirmation."
4. Customer completes payment.
- Verify selection uses util::PaymentStatus::PENDING and payment flow works correctly.
5. Invalid invoice ID entered.
- Verify system throws runtime_error with "Payment failed: invalid invoice ID."
Precondition:
1. Admin logged into system.
2. At least one invoice exists in datastore.
3. Notification system available.
Steps:
1. Navigate to Admin menu → Confirm Payment.
2. Select invoice with PAID status.
3. Confirm payment and check notification.
4. Attempt with empty invoice list.
5. Attempt with invalid invoice ID.
</Test>
<Review>
Sreeja Reghukumar
</Review>
<UserStory> SER1798: Update Job Status </UserStory>
<Changes>
1. Renamed Controller and ServiceManagementService methods from completeJob to updateJobStatus for clarity and flexibility.
2. Enhanced ServiceManagementService::updateJobStatus to support transitions:
- STARTED → INPROGRESS
- INPROGRESS → COMPLETED (with invoice generation and customer notification).
3. Added INPROGRESS state to ServiceJobStatus enum and updated string conversion utilities.
4. Introduced filterJobCards helper to generalize job filtering by status.
5. Updated TechnicianMenu to allow technicians to select job type (Started/Inprogress) and update status accordingly.
6. Improved job display to show current status and truncated service names for readability.
</Changes>
<Test>
Acceptance Criteria:
1. Technician can select a job with status STARTED and update it to INPROGRESS.
2. Technician can select a job with status INPROGRESS and update it to COMPLETED.
3. Completed bookings automatically generate invoices and send notifications to customers.
4. Job status updates are reflected in the technician’s job list and customer view.
Precondition:
1. Technician is logged into the system.
2. Assigned job cards exist with valid statuses (STARTED or INPROGRESS).
3. Datastore and payment service are available.
Steps:
1. Navigate to Technician menu and choose "Update Job Status".
- Verify that the system prompts for job type selection (Started/Inprogress).
2. Select a job card from the filtered list.
- Verify that the job card details are displayed with status.
3. Confirm update.
- Verify that the job status changes correctly.
4. For jobs updated to COMPLETED:
- Verify that the booking status is updated, invoice is generated, and notification is sent.
</Test>
<Review>
Sreeja Reghukumar, please review
</Review>
#1798
Changes:
- Added display options for users, services, combo packages and technician jobs
- Updated admin and technician menu options and navigation
- Added reusable helper functions for displaying data in tabular format
- Improved user and combo package listing displays
- Fixed minor validation and error message formatting issues
Changes:
- Added support for PaymentMode::NOTSET in string-to-enum conversion
to prevent invoice deserialization failures during system startup
- Improved invoice table column labels and spacing for better readability
and alignment in invoice display screens
Fixes#1789
Changes:
- Refactored customer and technician removal flow:
- Ensured linked job cards and service bookings are properly cancelled.
- Centralized cancellation logic with processBookingCancellation helper for consistent notifications, technician reassignment, and inventory restoration.
- Prevented duplicate inventory restocking during customer removal.
- Preserved customer references and IDs correctly during booking cancellation.
- Admin inventory management improvements:
- Added heading output to Remove Inventory Item submenu for clearer context.
- Prevented service creation with empty inventory selection by adding validation and early return.
- Improved combo package creation by simplifying null checks with modern idioms.
- Enhanced inventory selection flow:
- Clear screen and context header for better UX.
- Prevent duplicate item selection by checking already chosen items.
- Changed exit option from -1 to 0 for consistency.
- Added pressEnter prompt after successful item addition.
- Simplified pointer checks using concise conditions (e.g., if (item)).
- User management UI fix:
- Updated active user display in Remove User menu to include Full Name column, ensuring administrators have complete visibility when managing users.
Fixes#1788Fixes#1778Fixes#1781
Related work items: #1778, #1781, #1788
- Updated active user display to include Full Name column.
- Ensured both header and row output show full name alongside ID, username, and user type.
- Improved clarity of Remove User submenu by presenting complete user information.
Fixes#1788
- Added heading output to Remove Inventory Item submenu for clearer user context.
- Prevented service creation with empty inventory selection by adding validation and early return.
- Improved combo package creation by simplifying null checks with modern idioms.
- Enhanced inventory selection flow:
- Clear screen and context header for better UX.
- Prevent duplicate item selection by checking already chosen items.
- Changed exit option from -1 to 0 for consistency.
- Added pressEnter prompt after successful item addition.
- Simplified pointer checks using concise conditions (e.g., if (item)).
Fixes#1778
- Refactored customer and technician removal flow to ensure linked job cards and service bookings are properly cancelled.
- Added inventory restoration logic to avoid duplicate restocking when cancelling bookings.
- Introduced processBookingCancellation helper for consistent cancellation handling, notifications, and technician reassignment.
- Updated UserManagementService::removeUser to invoke appropriate cancellation routines based on user type.
- Ensured customer references and IDs are preserved correctly during booking cancellation.
Fixes#1781
- Added tabular invoice list for better navigation
- Enabled user to select an invoice before viewing full details
- Displayed Payment Mode in detailed invoice view
- Removed duplicate pressEnter() calls
- Improved console messages and formatting for clarity
Fixes#1784
- Changed combo package bookings to start with PENDING status
- Added filterComboPackages to list only active packages
- Improved CustomerMenu combo package selection with clearer messages and formatting
- Enhanced output with console clearing, spacing, and success feedback
- Added truncateString utility for consistent display of long names
- Updated filter functions to use reference parameters for efficiency
Fixes#1779
- Cleared console before displaying Complete Job screen
- Improved submenu header and formatting for clarity
- Prevented table headers from showing when no jobs exist
- Refined job completion flow with consistent messages
Fixes#1782
- change ServiceBooking ID prefix from `SRV` to `SBK`
- add customer notification when technician is assigned to booking
- fix typo in job completion exception message
- remove unnecessary newline characters from completion notifications
Fixes#1780
- Increased spacing between invoice table columns for better readability
- Updated invoice table headers with clearer labels
- Prevented screen clear before invoice listing display
- Changed payment mode selection to re-prompt on invalid input instead of defaulting to offline mode
- Removed unnecessary blank line before service listing display
Fixes#1786
- detach users from InventoryManagementService observers during removal
- detach users from PaymentManagementService observers during removal
- detach users from ServiceManagementService observers during removal
Fixes#1783
- Added ComboPackage dependency check in removeService; deactivates related packages when a service is removed.
- Added filterActiveServices helper to list only active services.
- Updated removeService and removeComboPackage with headings, empty-state checks, and consistent success/error messages.
- Enhanced createComboPackages:
- Uses active services only.
- Added cancel option and confirmation after first selection.
- Prevented duplicate selection and infinite loop when limited services exist.
- Improved feedback when all available services are selected.
- Updated selectServicesToRemove and selectComboPackage to handle empty states gracefully without exceptions.
Fixes#1749
- Assign Job to Technician:
- Added heading for clearer user guidance.
- Filtered only pending service bookings for assignment.
- Improved technician listing and selection with clearer prompts.
- Ensured booking status transitions correctly from PENDING to STARTED when job cards are created.
- Enhanced feedback messages for technician availability and job card creation.
- View Invoices:
- Added heading "View Invoices" for better UI consistency.
- Updated displayInvoices to take map by reference for efficiency.
- Improved formatting of invoice details with consistent spacing and line breaks.
- Added handling for empty invoice parts list (shows "No inventory items used").
- Enhanced error messages when encountering null invoices.
Fixes#1745Fixes#1752
- Added heading "Create Service" to submenu for clearer user guidance.
- Ensured console clears before service creation for consistent UI behavior.
- Filtered active inventory items before selection to avoid showing inactive items.
- Updated prompts with improved formatting and spacing (e.g., labour cost input, success message).
- Refactored selectInventoryItems:
- Added "Select Required Items" heading for clarity.
- Skipped null or inactive items during listing.
- Improved empty inventory message ("No Items Present, Inventory empty").
- Enhanced success and error messages with consistent line breaks.
- Simplified logic for item selection and exit handling.
Fixes#1747
- Updated AdminMenu::addTechnician:
- Added heading "Add Technician" for better user guidance.
- Removed setw formatting, replaced with simpler prompts.
- Ensured console clears before operation for consistency.
- Improved error messages for password, email, and phone validation with line breaks for readability.
- Enhanced success message with consistent spacing.
- Minor cleanup in TechnicianMenu.cpp by adding a blank line after file header for formatting consistency.
Fixed#1744
- Added heading "Add Inventory Item" to submenu for clearer user guidance.
- Updated option text from "Add Quantity" to "Restock Item".
- Ensured console clearing (util::clear) before add item and restock operations.
- Reformatted prompts with consistent spacing and line breaks (e.g., "Enter Item Details", "Select Item to Restock").
- Added default case handling in AdminMenu for invalid choices.
- Enhanced MenuHelper output:
- Extra line breaks for readability.
- Improved error messages ("Invalid index selected", "No active items available").
- Clearer success message when updating stock with new quantity.
Fixes#1740
Changes:
- Strengthened UserManagementService::updateUserDetails by checking duplicates only when email/phone are changed, preventing false errors
- Updated AdminMenu::viewStockLevels header text from "View Stock Level" to "View Stock Levels" for consistency
- Cleaned up CustomerMenu::updateDetails by removing unused user list retrieval and improving header/message formatting
- Included Validator.h in UserManagementService.cpp for duplicate checks.
- Enhanced updateUserDetails in UserManagementService to validate:
- Throw error if user does not exist.
- Throw error if email already exists among active users.
- Throw error if phone number already exists among active users.
- Implemented new duplicate validation functions in Validator.cpp:
- isUsernameDuplicate
- isPhoneDuplicate
- isEmailDuplicate
- Declared new duplicate validation functions in Validator.h.
- Updated CustomerMenu::updateDetails:
- Added "Update Details" header for clarity.
- Improved error messages with newline formatting.
- Added success message with newline formatting.
Fixes#1746
- Updated sendNotification in InventoryManagementService, PaymentManagementService, and ServiceManagementService to use only the provided title instead of prefixing with service name.
- Added "View Service History" header in CustomerMenu::viewServiceHistory for clarity.
- Adjusted column widths in service history table for better alignment:
- Booking ID column widened to 15.
- Vehicle Brand, Vehicle Number, Vehicle Model, Discount %, and Status columns widened to 20.
- Updated output formatting in CustomerMenu::viewServiceHistory to match new widths.
- Added "View and Delete Notification" header in MenuHelper::viewAndDeleteNotification for clarity.
- Moved empty notification validation from selectNotification to viewAndDeleteNotification:
- Displays "No notifications available." message.
- Added util::pressEnter() prompt before returning when no notifications exist.
- Increased Notification title column width from 30 to 35 in selectNotification for improved readability.
Fixes#1748
- Added "Complete Payments" header in CustomerMenu::completePayments for clarity.
- Implemented validation to check if invoices list is empty and display appropriate message.
- Added logic to verify presence of pending invoices before proceeding with payment.
- Enhanced error handling to show "Payment failed" with pressEnter prompt when no invoice is selected.
- Updated selectInvoiceFromUserForPayment in MenuHelper.h:
- Changed function to inline and added util::clear() at start.
- Updated column headers to "Technician ID" and "Technician Name" for clarity.
- Removed temporary AdminMenu.cpp file from enc_temp_folder.
Fixes#1750
- Added "Remove User" header in AdminMenu::removeUser for clarity.
- Updated filterActiveUsers in MenuHelper.h to exclude ADMIN users from the active user list.
Fixes#1742
- Added "Check Stock Availability" header in AdminMenu::checkStockAvailability for clarity.
- Updated prompt text to "Enter the Item ID" for consistency.
- Added util::clear() after reading Item ID to refresh the screen before displaying results.
- Implemented validation to show "Item not Found" message when the entered ID does not exist in inventory.
Fix#1741
- Added validation in AdminMenu::viewStockLevels to check for empty inventory before displaying.
- Added validation in AdminMenu::viewStockLevels to ensure only active items are shown.
- Added "View Stock Level" header for clarity.
- Adjusted column widths for Quantity and Price to 15 for better alignment.
- Added final newline and util::pressEnter() prompt after displaying stock levels.
Fixes #1739
- Set new service bookings to PENDING instead of STARTED
- Show message when no services are available
- Add Select a Service header
- Add Enter Vehicle Details header
- Improve service selection screen flow
Fixes#1753
- Check if user account is inactive before allowing login
- Add password confirmation in change password dialog
- Prevent changing password to the same value
- Standardize error messages to say "Invalid index" instead of "Invalid choice"
- Add blank line before system pause prompt
- Add "Change Password" header to change password screen
- Show error message when login fails
Fixes#1738Fixes#1736
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
Changes:
1. Added missing include for MenuHelper.h in project, AdminMenu, and CustomerMenu.
2. Updated PaymentManagementService::completePayment to guard against duplicate completion by checking status before updating.
3. Enhanced ServiceManagementService::createJobCard with null checks for inventory items and safe stock decrement logic.
4. Added null check for job card creation in ServiceManagementService and throw runtime error if creation fails.
5. Refactored ServiceManagementService::removeService to use m_dataStore.getServices() reference instead of getServices() copy.
6. Renamed helper function hasAllJobCardsinServiceBookingCompleted to hasCompletedAllJobs for clarity and updated usage in completeJob.
7. Fixed ServiceJobStatus string conversion in Enums.h to correctly return "PENDING" instead of "STARTED".
8. Added support for parsing "PENDING" string to ServiceJobStatus::PENDING in Enums.h.
9. Cleaned up AdminMenu.cpp by removing redundant static helper functions (listServiceBookings, selectPendingServiceBookings, listAvailableTechnicians, selectTechnician, selectInventoryItems, selectServicesToRemove).
10. Replaced removed helpers with shared MenuHelper usage and added util::pressEnter() calls for consistent user flow.
11. Simplified CustomerMenu.cpp by removing redundant static helpers (selectInvoiceFromUserForPayment, selectPaymentMode, displayInvoices) and moved logic to shared helpers.
12. General formatting and comment cleanup across AdminMenu.cpp and CustomerMenu.cpp for consistency.
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