Add standardized documentation headers
This commit is contained in:
@@ -1,3 +1,11 @@
|
||||
/*
|
||||
File: CustomerMenu.cpp
|
||||
Description: Implementation file containing the method definitions of the
|
||||
CustomerMenu class, including menu handling, service selection,
|
||||
combo package booking, profile updates, and password management.
|
||||
Author: Trenser
|
||||
Date:19-May-2026
|
||||
*/
|
||||
#include <iomanip>
|
||||
#include "CustomerMenu.h"
|
||||
#include "Service.h"
|
||||
@@ -11,6 +19,12 @@
|
||||
#include "Utility.h"
|
||||
#include "Map.h"
|
||||
|
||||
/*
|
||||
Function: showMenu
|
||||
Description: Displays the customer menu and handles user input until logout is selected.
|
||||
Parameter: None
|
||||
Return type: void
|
||||
*/
|
||||
void CustomerMenu::showMenu()
|
||||
{
|
||||
while (true)
|
||||
@@ -45,6 +59,12 @@ void CustomerMenu::showMenu()
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Function: handleOperation
|
||||
Description: Executes the corresponding customer operation based on the selected menu choice.
|
||||
Parameter: int choice - selected menu option
|
||||
Return type: bool - true if menu continues, false if logout
|
||||
*/
|
||||
bool CustomerMenu::handleOperation(int choice)
|
||||
{
|
||||
switch (choice)
|
||||
@@ -86,11 +106,23 @@ bool CustomerMenu::handleOperation(int choice)
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: logout
|
||||
Description: Logs out the currently authenticated customer user.
|
||||
Parameter: None
|
||||
Return type: void
|
||||
*/
|
||||
void CustomerMenu::logout()
|
||||
{
|
||||
m_controller.logout();
|
||||
}
|
||||
|
||||
/*
|
||||
Function: changePassword
|
||||
Description: Allows the customer to change their password after validation.
|
||||
Parameter: None
|
||||
Return type: void
|
||||
*/
|
||||
void CustomerMenu::changePassword()
|
||||
{
|
||||
std::string newPassword;
|
||||
@@ -108,6 +140,12 @@ void CustomerMenu::changePassword()
|
||||
util::pressEnter();
|
||||
}
|
||||
|
||||
/*
|
||||
Function: updateDetails
|
||||
Description: Allows the customer to update their email and phone number after validation.
|
||||
Parameter: None
|
||||
Return type: void
|
||||
*/
|
||||
void CustomerMenu::updateDetails()
|
||||
{
|
||||
std::string email, phone;
|
||||
@@ -133,6 +171,12 @@ void CustomerMenu::updateDetails()
|
||||
util::pressEnter();
|
||||
}
|
||||
|
||||
/*
|
||||
Function: selectServiceFromServices
|
||||
Description: Displays active services and allows the customer to select one by index.
|
||||
Parameter: const util::Map<std::string, const Service*>& services - list of services
|
||||
Return type: const Service* - selected service
|
||||
*/
|
||||
static const Service* selectServiceFromServices(const util::Map<std::string, const Service*>& services)
|
||||
{
|
||||
util::Map<int, const Service*> activeServicesMap;
|
||||
@@ -176,6 +220,13 @@ static const Service* selectServiceFromServices(const util::Map<std::string, con
|
||||
return activeServicesMap[userInputIndex];
|
||||
}
|
||||
|
||||
/*
|
||||
Function: selectService
|
||||
Description: Allows the customer to select a service, provide vehicle details,
|
||||
and book the service through the controller.
|
||||
Parameter: None
|
||||
Return type: void
|
||||
*/
|
||||
void CustomerMenu::selectService()
|
||||
{
|
||||
std::string vehicleNumber, vehicleBrand, vehicleModel;
|
||||
@@ -202,6 +253,12 @@ void CustomerMenu::selectService()
|
||||
util::pressEnter();
|
||||
}
|
||||
|
||||
/*
|
||||
Function: selectComboPackageFromPackages
|
||||
Description: Displays active combo packages and allows the customer to select one by index.
|
||||
Parameter: const util::Map<std::string, const ComboPackage*>& comboPackages - list of combo packages
|
||||
Return type: const ComboPackage* - selected combo package
|
||||
*/
|
||||
static const ComboPackage* selectComboPackageFromPackages(const util::Map<std::string, const ComboPackage*>& comboPackages)
|
||||
{
|
||||
util::Map<int, const ComboPackage*> activeComboPackages;
|
||||
@@ -244,6 +301,13 @@ static const ComboPackage* selectComboPackageFromPackages(const util::Map<std::s
|
||||
return activeComboPackages[userInputIndex];
|
||||
}
|
||||
|
||||
/*
|
||||
Function: selectComboPackage
|
||||
Description: Allows the customer to select a combo package, provide vehicle details,
|
||||
and book the package through the controller.
|
||||
Parameter: None
|
||||
Return type: void
|
||||
*/
|
||||
void CustomerMenu::selectComboPackage()
|
||||
{
|
||||
std::string vehicleNumber, vehicleBrand, vehicleModel;
|
||||
|
||||
Reference in New Issue
Block a user