Implement review fixes
This commit is contained in:
+6
-3
@@ -858,6 +858,7 @@ util::Map<std::string, ServiceBooking*> ServiceManagementService::getServiceBook
|
||||
DataStoreLockGuard lock(m_dataStore);
|
||||
util::Map<std::string, ServiceBooking*> serviceBookings;
|
||||
serviceBookings = util::getObjects(m_dataStore.getServiceBookings());
|
||||
return serviceBookings;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -896,9 +897,9 @@ Throws:
|
||||
*/
|
||||
void ServiceManagementService::createJobCard(const std::string& bookingID, const std::string& technicianID, const std::string& serviceID)
|
||||
{
|
||||
DataStoreLockGuard lock(m_dataStore);
|
||||
UserManagementService m_userManagementService;
|
||||
ServiceBooking* currentBooking = getServiceBooking(bookingID);
|
||||
DataStoreLockGuard lock(m_dataStore);
|
||||
auto& currentTrackedJobCards = m_dataStore.getJobCards();
|
||||
if (currentBooking == nullptr)
|
||||
{
|
||||
@@ -955,6 +956,7 @@ void ServiceManagementService::createJobCard(const std::string& bookingID, const
|
||||
title = "Technician assigned";
|
||||
message = "A technician has been assigned to your Service Booking with ID " + bookingID;
|
||||
sendNotification(currentBooking->getCustomer(), title, message);
|
||||
m_dataStore.saveJobCards();
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -972,9 +974,10 @@ Throws:
|
||||
*/
|
||||
void ServiceManagementService::createService(const std::string& name, const util::Vector<std::string>& inventoryItemIDs, double laborCost)
|
||||
{
|
||||
util::Map<std::string, InventoryItem*> currentServiceInventoryItems;
|
||||
DataStoreLockGuard lock(m_dataStore);
|
||||
util::Map<std::string, InventoryItem*> currentServiceInventoryItems;
|
||||
auto& trackedInventoryItems = m_dataStore.getInventoryItems();
|
||||
auto& currentServices = m_dataStore.getServices();
|
||||
for (int iteratorOne =0; iteratorOne < inventoryItemIDs.getSize(); iteratorOne++)
|
||||
{
|
||||
std::string currentItemID = inventoryItemIDs[iteratorOne];
|
||||
@@ -999,12 +1002,12 @@ void ServiceManagementService::createService(const std::string& name, const util
|
||||
{
|
||||
throw std::runtime_error("Unable to create new service.");
|
||||
}
|
||||
auto& currentServices = m_dataStore.getServices();
|
||||
if (currentServices.find(newService->getId()) != -1)
|
||||
{
|
||||
throw std::runtime_error("Service with this ID Already exists.");
|
||||
}
|
||||
currentServices.insert(newService->getId(), util::createNewRecord(newService));
|
||||
m_dataStore.saveServices();
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user