Add standardized documentation headers
This commit is contained in:
+44
-1
@@ -1,3 +1,11 @@
|
||||
/*
|
||||
File: ServiceManagementService.cpp
|
||||
Description: Implementation file containing the method definitions of the
|
||||
ServiceManagementService class, including service booking cancellation,
|
||||
job card management, combo package creation, and removal logic.
|
||||
Author: Trenser
|
||||
Date:19-May-2026
|
||||
*/
|
||||
#include "ServiceManagementService.h"
|
||||
#include "DataStore.h"
|
||||
#include "ServiceBooking.h"
|
||||
@@ -7,6 +15,14 @@
|
||||
#include "Factory.h"
|
||||
#include "ComboPackage.h"
|
||||
|
||||
/*
|
||||
Function: cancelCustomerServiceBookings
|
||||
Description: Cancels all service bookings associated with a given customer or technician.
|
||||
Updates booking status, resets customer/technician assignments, sends notifications,
|
||||
and restocks inventory items.
|
||||
Parameter: const std::string& userID - ID of the customer or technician
|
||||
Return type: void
|
||||
*/
|
||||
void ServiceManagementService::cancelCustomerServiceBookings(const std::string& userID)
|
||||
{
|
||||
const int INCREMENT_VALUE = 1;
|
||||
@@ -69,7 +85,13 @@ void ServiceManagementService::cancelCustomerServiceBookings(const std::string&
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Function: cancelTechnicianJobs
|
||||
Description: Cancels all jobs assigned to a technician. Updates job status, sends notifications,
|
||||
and restocks inventory items used in the service.
|
||||
Parameter: const std::string& technicianID - ID of the technician
|
||||
Return type: void
|
||||
*/
|
||||
void ServiceManagementService::cancelTechnicianJobs(const std::string& technicianID)
|
||||
{
|
||||
const int INCREMENT_VALUE = 1;
|
||||
@@ -101,6 +123,15 @@ void ServiceManagementService::cancelTechnicianJobs(const std::string& technicia
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Function: createComboPackage
|
||||
Description: Creates a new combo package with two services and a discount percentage.
|
||||
Validates service IDs, ensures uniqueness, and inserts the new package into the DataStore.
|
||||
Parameter: const std::string& packageName - name of the combo package
|
||||
const util::Vector<std::string>& serviceIDsInNewCombo - list of service IDs
|
||||
double discountPercentage - discount percentage for the package
|
||||
Return type: void
|
||||
*/
|
||||
void ServiceManagementService::createComboPackage(const std::string& packageName, const util::Vector<std::string>& serviceIDsInNewCombo, double discountPercentage)
|
||||
{
|
||||
if (packageName.empty())
|
||||
@@ -162,11 +193,23 @@ void ServiceManagementService::createComboPackage(const std::string& packageName
|
||||
comboPackageMap.insert(newComboPackage->getId(), newComboPackage);
|
||||
}
|
||||
|
||||
/*
|
||||
Function: getComboPackages
|
||||
Description: Retrieves all combo packages stored in the DataStore.
|
||||
Parameter: None
|
||||
Return type: util::Map<std::string, ComboPackage*>
|
||||
*/
|
||||
util::Map<std::string, ComboPackage*> ServiceManagementService::getComboPackages()
|
||||
{
|
||||
return m_dataStore.getComboPackages();
|
||||
}
|
||||
|
||||
/*
|
||||
Function: removeComboPackage
|
||||
Description: Removes a combo package by marking it inactive. Throws an exception if the package ID is not found.
|
||||
Parameter: const std::string& comboPackageID - ID of the combo package
|
||||
Return type: void
|
||||
*/
|
||||
void ServiceManagementService::removeComboPackage(const std::string& comboPackageID)
|
||||
{
|
||||
bool removed = false;
|
||||
|
||||
Reference in New Issue
Block a user