Merge branch 'feature-service-management-ser002' into feature-service-management
This commit is contained in:
+15
@@ -67,4 +67,19 @@ void ServiceManagementService::createJobCard(const std::string& bookingID, const
|
||||
JobCard* jobCard = Factory::getObject<JobCard>(bookingID, currentBooking, currentService, serviceID, technicianID, selectedTechnician, util::ServiceJobStatus::STARTED);
|
||||
currentJobCards.insert(jobCard->getId(), jobCard);
|
||||
sendNotification(selectedTechnician,title, message);
|
||||
}
|
||||
|
||||
void ServiceManagementService::createService(const std::string& name, const util::Vector<std::string>& inventoryItemIDs, double laborCost)
|
||||
{
|
||||
Service* newService = Factory::getObject<Service>(name, inventoryItemIDs, laborCost);
|
||||
if (newService == nullptr)
|
||||
{
|
||||
throw std::runtime_error("Unable to create new service.");
|
||||
}
|
||||
util::Map<std::string, Service*>& currentServices = m_dataStore.getServices();
|
||||
if (currentServices.find(newService->getId()) != -1)
|
||||
{
|
||||
throw std::runtime_error("Service with this ID Already exists.");
|
||||
}
|
||||
currentServices.insert(newService->getId(), newService);
|
||||
}
|
||||
Reference in New Issue
Block a user