169 lines
4.5 KiB
C++
169 lines
4.5 KiB
C++
#include <stdexcept>
|
|
#include "Controller.h"
|
|
#include "User.h"
|
|
|
|
bool Controller::login(const std::string& username, const std::string& password)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
void Controller::logout()
|
|
{
|
|
}
|
|
|
|
void Controller::changePassword(const std::string& newPassword)
|
|
{
|
|
}
|
|
|
|
void Controller::createCustomer(const std::string& username, const std::string& password, const std::string& email, const std::string& phone)
|
|
{
|
|
}
|
|
|
|
const User* Controller::getAuthenticatedUser()
|
|
{
|
|
return nullptr;
|
|
}
|
|
|
|
void Controller::createTechnician(const std::string& username, const std::string& password, const std::string& email, const std::string& phone)
|
|
{
|
|
}
|
|
|
|
void Controller::updateUserDetails(const std::string& email, const std::string& phone)
|
|
{
|
|
}
|
|
|
|
util::Map<std::string, const Service*> Controller::getServices()
|
|
{
|
|
return util::Map<std::string, const Service*>();
|
|
}
|
|
|
|
util::Map<std::string, const ComboPackage*> Controller::getComboPackages()
|
|
{
|
|
return util::Map<std::string, const ComboPackage*>();
|
|
}
|
|
|
|
void Controller::purchaseService(const util::Vector<std::string>& serviceIDs, const std::string& vehicleNumber, const std::string& vehicleBrand, const std::string& vehicleModel)
|
|
{
|
|
}
|
|
|
|
void Controller::purchaseComboPackage(const std::string& comboPackageID, const std::string& vehicleNumber, const std::string& vehicleBrand, const std::string& vehicleModel)
|
|
{
|
|
}
|
|
|
|
util::Map<std::string, const InventoryItem*> Controller::getInventoryItems()
|
|
{
|
|
return util::Map<std::string, const InventoryItem*>();
|
|
}
|
|
|
|
const InventoryItem* Controller::getInventoryItem(const std::string& inventoryItemID)
|
|
{
|
|
return nullptr;
|
|
}
|
|
|
|
void Controller::addInventoryItem(const std::string& partName, int quantity, double price)
|
|
{
|
|
}
|
|
|
|
void Controller::removeInventoryItem(const std::string& inventoryItemID)
|
|
{
|
|
}
|
|
|
|
util::Map<std::string, const ServiceBooking*> Controller::getServiceBookings()
|
|
{
|
|
return util::Map<std::string, const ServiceBooking*>();
|
|
}
|
|
|
|
util::Map<std::string, const ServiceBooking*> Controller::getServiceBookingsByUser(const std::string userID)
|
|
{
|
|
return util::Map<std::string, const ServiceBooking*>();
|
|
}
|
|
|
|
util::Map<std::string, const User*> Controller::getUsers()
|
|
{
|
|
return util::Map<std::string, const User*>();
|
|
}
|
|
|
|
util::Map<std::string, const User*> Controller::getUsers(util::UserType userType)
|
|
{
|
|
return util::Map<std::string, const User*>();
|
|
}
|
|
|
|
void Controller::createJobCard(const std::string& bookingID, const std::string& technicianID, const std::string& serviceID)
|
|
{
|
|
}
|
|
|
|
void Controller::createService(const std::string& name, const util::Vector<std::string>& inventoryItemIDs, double laborCost)
|
|
{
|
|
}
|
|
|
|
void Controller::removeService(const std::string& serviceID)
|
|
{
|
|
}
|
|
|
|
util::Map<std::string, const JobCard*> Controller::getJobCardsByUser()
|
|
{
|
|
return util::Map<std::string, const JobCard*>();
|
|
}
|
|
|
|
void Controller::completeJob(const std::string& jobID)
|
|
{
|
|
}
|
|
|
|
void Controller::removeUser(const std::string& userID)
|
|
{
|
|
}
|
|
|
|
void Controller::createComboPackage(const std::string& name, const util::Vector<std::string>& serviceIDs, double discountPercentage)
|
|
{
|
|
}
|
|
|
|
void Controller::removeComboPackage(const std::string& comboPackageID)
|
|
{
|
|
}
|
|
|
|
util::Map<std::string, const Invoice*> Controller::getInvoicesByUser()
|
|
{
|
|
return util::Map<std::string, const Invoice*>();
|
|
}
|
|
|
|
void Controller::completePayment(const std::string& invoiceID, util::PaymentMode paymentMode)
|
|
{
|
|
}
|
|
|
|
util::Vector<const Notification*> Controller::getNotifications()
|
|
{
|
|
const User* authenticatedUser = m_authenticationManagementService.getAuthenticatedUser();
|
|
if (!authenticatedUser)
|
|
{
|
|
throw std::runtime_error("No user is currently logged in!");
|
|
}
|
|
auto notifications = m_userManagementService.getUserNotifications(authenticatedUser->getId());
|
|
int numberOfNotifications = notifications.getSize();
|
|
util::Vector<const Notification*> readOnlyNotifications;
|
|
for (int index = 0; index < numberOfNotifications; index++)
|
|
{
|
|
readOnlyNotifications.push_back(notifications[index]);
|
|
}
|
|
return readOnlyNotifications;
|
|
}
|
|
|
|
void Controller::deleteNotification(const std::string& notificationID)
|
|
{
|
|
const User* authenticatedUser = m_authenticationManagementService.getAuthenticatedUser();
|
|
if (!authenticatedUser)
|
|
{
|
|
throw std::runtime_error("No user is currently logged in!");
|
|
}
|
|
m_userManagementService.deleteNotification(notificationID, authenticatedUser->getId());
|
|
}
|
|
|
|
void Controller::configureNotifications(const std::string& userID, bool paymentNotifications, bool serviceNotifications)
|
|
{
|
|
}
|
|
|
|
void Controller::runSystemChecks()
|
|
{
|
|
m_inventoryManagementService.sendLowStockAlerts();
|
|
}
|
|
|