Merge branch 'feature-service-management-ser002' into feature-service-management

This commit is contained in:
Jissin Mathew
2026-05-21 16:54:07 +05:30
4 changed files with 96 additions and 1 deletions
@@ -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);
}