Change static functions to inline in MenuHelper

Fixes #1754
This commit is contained in:
2026-05-26 12:40:27 +05:30
parent 8d07b11eae
commit fb509ccb3f
@@ -91,7 +91,7 @@ Parameters:
Returns: Returns:
- void - void
*/ */
static void selectInventoryItems(util::Map<std::string, const InventoryItem*>& currentInventoryItems, util::Vector<std::string>& selectedInventoryItems) inline void selectInventoryItems(util::Map<std::string, const InventoryItem*>& currentInventoryItems, util::Vector<std::string>& selectedInventoryItems)
{ {
bool doRun = true, hasInventoryItems = false; bool doRun = true, hasInventoryItems = false;
util::Map<int, const InventoryItem*> currentInventoryMap; util::Map<int, const InventoryItem*> currentInventoryMap;
@@ -166,7 +166,7 @@ Parameters:
Returns: Returns:
- bool: True if pending services exist, False otherwise - bool: True if pending services exist, False otherwise
*/ */
static bool listServiceBookings(util::Map<std::string, const ServiceBooking*>& currentBookings, int& bookingsSize, util::Map<int, const ServiceBooking*>& serviceBookingsMap) inline bool listServiceBookings(util::Map<std::string, const ServiceBooking*>& currentBookings, int& bookingsSize, util::Map<int, const ServiceBooking*>& serviceBookingsMap)
{ {
int currentIndex = 1; int currentIndex = 1;
bool hasPendingService = false; bool hasPendingService = false;
@@ -220,7 +220,7 @@ Parameters:
Returns: Returns:
- const ServiceBooking*: Pointer to the selected booking, or nullptr if invalid - const ServiceBooking*: Pointer to the selected booking, or nullptr if invalid
*/ */
static const ServiceBooking* selectPendingServiceBookings(util::Map<int, const ServiceBooking*>& serviceBookingsMap) inline const ServiceBooking* selectPendingServiceBookings(util::Map<int, const ServiceBooking*>& serviceBookingsMap)
{ {
int userInputIndex; int userInputIndex;
std::cout << "Enter a valid service index: "; std::cout << "Enter a valid service index: ";
@@ -246,7 +246,7 @@ Parameters:
Returns: Returns:
- void - void
*/ */
static void listAvailableTechnicians(util::Map<std::string, const User*> currentAvailableTechnicians, int numberOfTechnicians, util::Map<int, const User*>& currentAvailableTechniciansMap) inline void listAvailableTechnicians(util::Map<std::string, const User*> currentAvailableTechnicians, int numberOfTechnicians, util::Map<int, const User*>& currentAvailableTechniciansMap)
{ {
bool hasTechnicians = false; bool hasTechnicians = false;
int currentIndex = 1; int currentIndex = 1;
@@ -284,7 +284,7 @@ Parameters:
Returns: Returns:
- const User*: Pointer to the selected technician, or nullptr if invalid - const User*: Pointer to the selected technician, or nullptr if invalid
*/ */
static const User* selectTechnician(util::Map<int, const User*>& currentAvailableTechniciansMap) inline const User* selectTechnician(util::Map<int, const User*>& currentAvailableTechniciansMap)
{ {
int userInputIndex; int userInputIndex;
util::read(userInputIndex); util::read(userInputIndex);
@@ -307,7 +307,7 @@ Parameters:
Returns: Returns:
- std::string: ID of the selected invoice, or empty string if none selected - std::string: ID of the selected invoice, or empty string if none selected
*/ */
static std::string selectInvoiceFromUserForPayment(const util::Map<std::string, const Invoice*>& currentInvoices) inline std::string selectInvoiceFromUserForPayment(const util::Map<std::string, const Invoice*>& currentInvoices)
{ {
int currentIndex = 1, choice; int currentIndex = 1, choice;
util::Map<int, const Invoice*> pendingInvoicesForPayment; util::Map<int, const Invoice*> pendingInvoicesForPayment;
@@ -372,7 +372,7 @@ Parameters:
Returns: Returns:
- util::PaymentMode: Selected payment mode - util::PaymentMode: Selected payment mode
*/ */
static util::PaymentMode selectPaymentMode() inline util::PaymentMode selectPaymentMode()
{ {
int choice; int choice;
std::cout << "Enter the payment Mode\n1.OFFLINE\n2.ONLINE\nChoice: "; std::cout << "Enter the payment Mode\n1.OFFLINE\n2.ONLINE\nChoice: ";
@@ -405,7 +405,7 @@ Returns:
Throws: Throws:
- std::runtime_error if a null invoice is encountered - std::runtime_error if a null invoice is encountered
*/ */
static void displayInvoices(util::Map<std::string, const Invoice*> currentUserInvoices) inline void displayInvoices(util::Map<std::string, const Invoice*> currentUserInvoices)
{ {
if (currentUserInvoices.getSize() == 0) if (currentUserInvoices.getSize() == 0)
{ {
@@ -471,7 +471,7 @@ Parameters:
Returns: Returns:
- std::string: ID of the selected job card, or empty string if none selected - std::string: ID of the selected job card, or empty string if none selected
*/ */
static std::string selectJobCardToComplete(util::Map<std::string, const JobCard*>& assignedJobCards, util::Map<int, const JobCard*>& incompleteJobCards) inline std::string selectJobCardToComplete(util::Map<std::string, const JobCard*>& assignedJobCards, util::Map<int, const JobCard*>& incompleteJobCards)
{ {
int currentIndex = 1; int currentIndex = 1;
int choice; int choice;