Fix PR review comments and refactor menu helper logic
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
This commit is contained in:
+10
-3
@@ -6,6 +6,7 @@ Description: Implementation file containing the method definitions of the
|
||||
Author: Trenser
|
||||
Date:19-May-2026
|
||||
*/
|
||||
|
||||
#include "ServiceManagementService.h"
|
||||
#include "DataStore.h"
|
||||
#include "ServiceBooking.h"
|
||||
@@ -54,12 +55,16 @@ void ServiceManagementService::cancelCustomerServiceBookings(const std::string&
|
||||
booking->setCustomer(nullptr);
|
||||
booking->setCustomerId("");
|
||||
User* assignedTechnician = booking->getAssignedTechnician();
|
||||
sendNotification(assignedTechnician, "Customer Service Cancelled", "Uh?Oh. The customer has cancelled their service booking. Your assigned job card has been cancelled and the inventory has been restocked.");
|
||||
std::string title = "Customer Service Cancelled";
|
||||
std::string message = "The customer has cancelled their service booking. Your assigned job card has been cancelled and the inventory has been restocked.";
|
||||
sendNotification(assignedTechnician, title, message);
|
||||
}
|
||||
else if (type == util::UserType::TECHNICIAN)
|
||||
{
|
||||
booking->setStatus(util::ServiceJobStatus::PENDING);
|
||||
sendNotification(booking->getCustomer(), "Technician Unavailable", "Your assigned technician is no longer available. Your booking has been reset to pending, and we will reassign a new technician shortly.");
|
||||
std::string title = "Technician Unavailable";
|
||||
std::string message = "Your assigned technician is no longer available. Your booking has been reset to pending, and we will reassign a new technician shortly.";
|
||||
sendNotification(booking->getCustomer(), title, message);
|
||||
}
|
||||
booking->setAssignedTechnician(nullptr);
|
||||
booking->setAssignedTechnicianId("");
|
||||
@@ -104,7 +109,9 @@ void ServiceManagementService::cancelTechnicianJobs(const std::string& technicia
|
||||
if (job->getStatus() == util::ServiceJobStatus::PENDING || job->getStatus() == util::ServiceJobStatus::STARTED)
|
||||
{
|
||||
job->setStatus(util::ServiceJobStatus::CANCELLED);
|
||||
sendNotification(job->getTechnician(), "Job Cancelled", "The Job has cancelled. Your job card has been cancelled and the inventory has been restocked.");
|
||||
std::string title = "Job Cancelled";
|
||||
std::string message = "The Job has cancelled. Your job card has been cancelled and the inventory has been restocked.";
|
||||
sendNotification(job->getTechnician(), title, message);
|
||||
Service* service = job->getService();
|
||||
if (service != nullptr)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user