Update controller methods and fix const issues
Changes: - Added stub implementations for Controller.cpp methods - Fixed const issue in UserInterface methods (run, login, registerCustomer, handleOperation) - Changed return types to use const pointers for read-only objects - Updated maps and vectors to return const object pointers - Fixed some function parameter names and signatures for consistency
This commit is contained in:
@@ -1 +1,139 @@
|
||||
#include "Controller.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()
|
||||
{
|
||||
}
|
||||
|
||||
util::Map<std::string, const ComboPackage*> Controller::getComboPackages()
|
||||
{
|
||||
}
|
||||
|
||||
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()
|
||||
{
|
||||
}
|
||||
|
||||
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()
|
||||
{
|
||||
}
|
||||
|
||||
util::Map<std::string, const ServiceBooking*> Controller::getServiceBookingsByUser(const std::string userID)
|
||||
{
|
||||
}
|
||||
|
||||
util::Map<std::string, const User*> Controller::getUsers()
|
||||
{
|
||||
}
|
||||
|
||||
util::Map<std::string, const User*> Controller::getUsers(util::UserType userType)
|
||||
{
|
||||
}
|
||||
|
||||
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()
|
||||
{
|
||||
}
|
||||
|
||||
void Controller::deleteNotification(const std::string& notificationID)
|
||||
{
|
||||
}
|
||||
|
||||
void Controller::configureNotifications(const std::string& userID, bool paymentNotifications, bool serviceNotifications)
|
||||
{
|
||||
}
|
||||
|
||||
void Controller::runSystemChecks()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
+12
-12
@@ -19,32 +19,32 @@ public:
|
||||
void logout();
|
||||
void changePassword(const std::string& newPassword);
|
||||
void createCustomer(const std::string& username, const std::string& password, const std::string& email, const std::string& phone);
|
||||
User* const getAuthenticatedUser();
|
||||
const User* getAuthenticatedUser();
|
||||
void createTechnician(const std::string& username, const std::string& password, const std::string& email, const std::string& phone);
|
||||
void updateUserDetails(const std::string& email, const std::string& phone);
|
||||
util::Map<std::string, Service*> getServices();
|
||||
util::Map<std::string, ComboPackage*> getComboPackages();
|
||||
util::Map<std::string, const Service*> getServices();
|
||||
util::Map<std::string, const ComboPackage*> getComboPackages();
|
||||
void purchaseService(const util::Vector<std::string>& serviceIDs, const std::string& vehicleNumber, const std::string& vehicleBrand, const std::string& vehicleModel);
|
||||
void purchaseComboPackage(const std::string& comboPackageID, const std::string& vehicleNumber, const std::string& vehicleBrand, const std::string& vehicleModel);
|
||||
util::Map<std::string, InventoryItem*> getInventoryItems();
|
||||
InventoryItem* getInventoryItem(const std::string& inventoryItemID);
|
||||
util::Map<std::string, const InventoryItem*> getInventoryItems();
|
||||
const InventoryItem* getInventoryItem(const std::string& inventoryItemID);
|
||||
void addInventoryItem(const std::string& partName, int quantity, double price);
|
||||
void removeInventoryItem(const std::string& inventoryItemID);
|
||||
util::Map<std::string, ServiceBooking*> getServiceBookings();
|
||||
util::Map<std::string, ServiceBooking*> getServiceBookingsByUser();
|
||||
util::Map<std::string, User*> getUsers();
|
||||
util::Map<std::string, User*> getUsers(util::UserType type);
|
||||
util::Map<std::string, const ServiceBooking*> getServiceBookings();
|
||||
util::Map<std::string, const ServiceBooking*> getServiceBookingsByUser(const std::string userID);
|
||||
util::Map<std::string, const User*> getUsers();
|
||||
util::Map<std::string, const User*> getUsers(util::UserType userType);
|
||||
void createJobCard(const std::string& bookingID, const std::string& technicianID, const std::string& serviceID);
|
||||
void createService(const std::string& name, const util::Vector<std::string>& inventoryItemIDs, double laborCost);
|
||||
void removeService(const std::string& serviceID);
|
||||
util::Map<std::string, JobCard*> getJobCardsByUser();
|
||||
util::Map<std::string, const JobCard*> getJobCardsByUser();
|
||||
void completeJob(const std::string& jobID);
|
||||
void removeUser(const std::string& userID);
|
||||
void createComboPackage(const std::string& name, const util::Vector<std::string>& serviceIDs, double discountPercentage);
|
||||
void removeComboPackage(const std::string& comboPackageID);
|
||||
util::Map<std::string, Invoice*> getInvoicesByUser();
|
||||
util::Map<std::string, const Invoice*> getInvoicesByUser();
|
||||
void completePayment(const std::string& invoiceID, util::PaymentMode paymentMode);
|
||||
util::Vector<Notification*> getNotifications();
|
||||
util::Vector<const Notification*> getNotifications();
|
||||
void deleteNotification(const std::string& notificationID);
|
||||
void configureNotifications(const std::string& userID, bool paymentNotifications, bool serviceNotifications);
|
||||
void runSystemChecks();
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#include "InputHelper.h"
|
||||
#include "OutputHelper.h"
|
||||
|
||||
void UserInterface::run() const
|
||||
void UserInterface::run()
|
||||
{
|
||||
bool isMenuActive = true;
|
||||
while (isMenuActive)
|
||||
@@ -26,7 +26,7 @@ void UserInterface::run() const
|
||||
}
|
||||
}
|
||||
|
||||
bool UserInterface::handleOperation(int choice) const
|
||||
bool UserInterface::handleOperation(int choice)
|
||||
{
|
||||
switch (choice)
|
||||
{
|
||||
@@ -46,12 +46,12 @@ bool UserInterface::handleOperation(int choice) const
|
||||
return true;
|
||||
}
|
||||
|
||||
void UserInterface::login() const
|
||||
void UserInterface::login()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void UserInterface::registerCustomer() const
|
||||
void UserInterface::registerCustomer()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -11,10 +11,10 @@ private:
|
||||
AdminMenu m_adminMenu;
|
||||
TechnicianMenu m_technicianMenu;
|
||||
CustomerMenu m_customerMenu;
|
||||
bool handleOperation(int choice) const;
|
||||
bool handleOperation(int choice);
|
||||
public:
|
||||
UserInterface() {}
|
||||
void run() const;
|
||||
void login() const;
|
||||
void registerCustomer() const;
|
||||
void run();
|
||||
void login();
|
||||
void registerCustomer();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user