Merge branch 'feature-service-management-ser003' into feature-service-management
This commit is contained in:
+19
@@ -5,6 +5,7 @@
|
||||
#include "JobCard.h"
|
||||
#include "Timestamp.h"
|
||||
#include "Service.h"
|
||||
#include "Enums.h"
|
||||
#include "InventoryItem.h"
|
||||
|
||||
util::Map<std::string, ServiceBooking*> ServiceManagementService::getServiceBookings()
|
||||
@@ -82,4 +83,22 @@ void ServiceManagementService::createService(const std::string& name, const util
|
||||
throw std::runtime_error("Service with this ID Already exists.");
|
||||
}
|
||||
currentServices.insert(newService->getId(), newService);
|
||||
}
|
||||
|
||||
util::Map<std::string, Service*> ServiceManagementService::getServices()
|
||||
{
|
||||
return m_dataStore.getServices();
|
||||
}
|
||||
|
||||
void ServiceManagementService::removeService(const std::string& serviceID)
|
||||
{
|
||||
util::Map<std::string, Service*> currentServices = getServices();
|
||||
if (currentServices.find(serviceID) != -1)
|
||||
{
|
||||
currentServices.getValueAt(currentServices.find(serviceID))->setState(util::State::INACTIVE);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw std::runtime_error("Service not found.");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user