175 lines
4.8 KiB
C++
175 lines
4.8 KiB
C++
#include "Controller.h"
|
||
#include "User.h"
|
||
#include "Invoice.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)
|
||
{
|
||
}
|
||
|
||
/*
|
||
Function: getInvoicesByUser
|
||
Description: Retrieves all invoices associated with the currently authenticated user.
|
||
Converts them into a read-only map before returning.
|
||
Parameters:
|
||
- None
|
||
Returns:
|
||
- util::Map<std::string, const Invoice*> containing the user’s invoices
|
||
*/
|
||
util::Map<std::string, const Invoice*> Controller::getInvoicesByUser()
|
||
{
|
||
User* currentUser = m_authenticationManagementService.getAuthenticatedUser();
|
||
util::Map<std::string, Invoice*> currentUserInvoices = m_paymentManagementService.getInvoices(currentUser->getId());
|
||
util::Map<std::string, const Invoice*> userInvoicesReadOnly;
|
||
for (int iterator = 0; iterator < currentUserInvoices.getSize(); iterator++)
|
||
{
|
||
Invoice* currentInvoice = currentUserInvoices.getValueAt(iterator);
|
||
userInvoicesReadOnly.insert(currentInvoice->getId(), currentInvoice);
|
||
}
|
||
return userInvoicesReadOnly;
|
||
}
|
||
|
||
/*
|
||
Function: completePayment
|
||
Description: Completes payment for a specific invoice using the given payment mode.
|
||
Parameters:
|
||
- invoiceID: std::string, ID of the invoice to be paid
|
||
- paymentMode: util::PaymentMode, mode of payment (e.g., ONLINE, OFFLINE)
|
||
Returns:
|
||
- void
|
||
*/
|
||
void Controller::completePayment(const std::string& invoiceID, util::PaymentMode paymentMode)
|
||
{
|
||
m_paymentManagementService.completePayment(invoiceID, paymentMode);
|
||
}
|
||
|
||
util::Vector<const Notification*> Controller::getNotifications()
|
||
{
|
||
return util::Vector<const Notification*>();
|
||
}
|
||
|
||
void Controller::deleteNotification(const std::string& notificationID)
|
||
{
|
||
}
|
||
|
||
void Controller::configureNotifications(const std::string& userID, bool paymentNotifications, bool serviceNotifications)
|
||
{
|
||
}
|
||
|
||
void Controller::runSystemChecks()
|
||
{
|
||
} |