Implement Review Fixes
This commit is contained in:
+1
-5
@@ -600,7 +600,6 @@ Return type: void
|
||||
*/
|
||||
void ServiceManagementService::cancelCustomerServiceBookings(const std::string& customerID)
|
||||
{
|
||||
const int INCREMENT_VALUE = 1;
|
||||
auto& users = m_dataStore.getUsers();
|
||||
int userIndex = users.find(customerID);
|
||||
if (userIndex == -1)
|
||||
@@ -621,7 +620,6 @@ void ServiceManagementService::cancelCustomerServiceBookings(const std::string&
|
||||
{
|
||||
continue;
|
||||
}
|
||||
std::string bookingID = booking->getId();
|
||||
if (booking->getCustomerId() != customerID)
|
||||
{
|
||||
continue;
|
||||
@@ -634,7 +632,7 @@ void ServiceManagementService::cancelCustomerServiceBookings(const std::string&
|
||||
std::string titleToTechnician = "Customer Service Cancelled";
|
||||
std::string messageToTechnician = "The customer has cancelled their service booking. Your assigned job card has been cancelled and the inventory has been restocked.";
|
||||
std::string jobTitle = "Job Cancelled";
|
||||
std::string jobMessage = "The Job has cancelled. Your job card has been cancelled and the inventory has been restocked.";
|
||||
std::string jobMessage = "The job has been cancelled. Your job card has been cancelled and the inventory has been restocked.";
|
||||
processBookingCancellation(booking,
|
||||
util::ServiceJobStatus::CANCELLED,
|
||||
titleToTechnician, messageToTechnician, assignedTechnician,
|
||||
@@ -653,7 +651,6 @@ Return type: void
|
||||
*/
|
||||
void ServiceManagementService::cancelTechnicianJobs(const std::string& technicianID)
|
||||
{
|
||||
const int INCREMENT_VALUE = 1;
|
||||
auto& users = m_dataStore.getUsers();
|
||||
int userIndex = users.find(technicianID);
|
||||
if (userIndex == -1)
|
||||
@@ -679,7 +676,6 @@ void ServiceManagementService::cancelTechnicianJobs(const std::string& technicia
|
||||
{
|
||||
continue;
|
||||
}
|
||||
std::string bookingID = booking->getId();
|
||||
if (booking->getStatus() != util::ServiceJobStatus::PENDING && booking->getStatus() != util::ServiceJobStatus::STARTED)
|
||||
{
|
||||
continue;
|
||||
|
||||
+2
-2
@@ -304,6 +304,8 @@ void UserManagementService::removeUser(const std::string& userID)
|
||||
if (index != -1)
|
||||
{
|
||||
User* user = m_dataStore.getUsers().getValueAt(index);
|
||||
if (user != nullptr)
|
||||
{
|
||||
if (user->getUserType() == util::UserType::CUSTOMER)
|
||||
{
|
||||
serviceManagementService.cancelCustomerServiceBookings(userID);
|
||||
@@ -312,8 +314,6 @@ void UserManagementService::removeUser(const std::string& userID)
|
||||
{
|
||||
serviceManagementService.cancelTechnicianJobs(userID);
|
||||
}
|
||||
if (user != nullptr)
|
||||
{
|
||||
user->setState(util::State::INACTIVE);
|
||||
inventoryManagementService.detach(user);
|
||||
paymentManagementService.detach(user);
|
||||
|
||||
Reference in New Issue
Block a user