Add standardized documentation headers
This commit is contained in:
@@ -1,10 +1,23 @@
|
||||
/*
|
||||
File: AdminMenu.cpp
|
||||
Description: Implementation file containing the method definitions of the
|
||||
AdminMenu class, including menu handling, inventory operations,
|
||||
and stock management functions.
|
||||
Author: Trenser
|
||||
Date:19-May-2026
|
||||
*/
|
||||
#include <iomanip>
|
||||
#include "AdminMenu.h"
|
||||
#include "InventoryItem.h"
|
||||
#include "InputHelper.h"
|
||||
#include "OutputHelper.h"
|
||||
#include "InventoryItem.h"
|
||||
|
||||
/*
|
||||
Function: showMenu
|
||||
Description: Displays the admin menu and handles user input until the menu is exited.
|
||||
Parameter: None
|
||||
Return type: void
|
||||
*/
|
||||
void AdminMenu::showMenu()
|
||||
{
|
||||
bool isMenuActive = true;
|
||||
@@ -43,6 +56,13 @@ void AdminMenu::changePassword()
|
||||
{
|
||||
}
|
||||
|
||||
/*
|
||||
Function: viewStockLevels
|
||||
Description: Displays all active inventory items with their details
|
||||
including ID, part name, quantity, and price.
|
||||
Parameter: None
|
||||
Return type: void
|
||||
*/
|
||||
void AdminMenu::viewStockLevels()
|
||||
{
|
||||
auto inventoryItems = m_controller.getInventoryItems();
|
||||
@@ -68,6 +88,14 @@ void AdminMenu::viewStockLevels()
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Function: filterActiveItems
|
||||
Description: Filters out inactive inventory items and returns a map
|
||||
containing only active items.
|
||||
Parameter: const util::Map<std::string, const InventoryItem*>& inventoryItems -
|
||||
map of all inventory items
|
||||
Return type: util::Map<std::string, const InventoryItem*>
|
||||
*/
|
||||
static util::Map<std::string, const InventoryItem*>
|
||||
filterActiveItems(const util::Map<std::string, const InventoryItem*>& inventoryItems)
|
||||
{
|
||||
@@ -84,6 +112,14 @@ filterActiveItems(const util::Map<std::string, const InventoryItem*>& inventoryI
|
||||
return activeItems;
|
||||
}
|
||||
|
||||
/*
|
||||
Function: displayInventoryWithItems
|
||||
Description: Displays inventory items in a tabular format with index, ID,
|
||||
part name, quantity, and price.
|
||||
Parameter: util::Map<std::string, const InventoryItem*>& inventoryItems -
|
||||
map of inventory items to display
|
||||
Return type: void
|
||||
*/
|
||||
static void displayInventoryWithItems(util::Map<std::string, const InventoryItem*>& inventoryItems)
|
||||
{
|
||||
int inventorySize = inventoryItems.getSize();
|
||||
@@ -108,6 +144,15 @@ static void displayInventoryWithItems(util::Map<std::string, const InventoryItem
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Function: addQuantityToItem
|
||||
Description: Allows the admin to select an active inventory item and
|
||||
increase its stock quantity.
|
||||
Parameter: util::Map<std::string, const InventoryItem*>& inventoryItems -
|
||||
map of inventory items
|
||||
Controller& m_controller - controller instance to update stock
|
||||
Return type: void
|
||||
*/
|
||||
static void addQuantityToItem(util::Map<std::string, const InventoryItem*>& inventoryItems, Controller& m_controller)
|
||||
{
|
||||
int itemIndex;
|
||||
@@ -149,6 +194,13 @@ static void addQuantityToItem(util::Map<std::string, const InventoryItem*>& inve
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Function: addInventoryItem
|
||||
Description: Allows the admin to either add a new inventory item
|
||||
or increase the quantity of an existing item.
|
||||
Parameter: None
|
||||
Return type: void
|
||||
*/
|
||||
void AdminMenu::addInventoryItem()
|
||||
{
|
||||
util::clear();
|
||||
@@ -182,14 +234,13 @@ void AdminMenu::addInventoryItem()
|
||||
util::pressEnter();
|
||||
}
|
||||
|
||||
static util::Map<std::string, const InventoryItem*>
|
||||
filterActiveItems(const util::Map<std::string, const InventoryItem*>& inventoryItems)
|
||||
{ }
|
||||
|
||||
static void displayInventoryWithItems(util::Map<std::string, const InventoryItem*>& inventoryItems)
|
||||
{
|
||||
}
|
||||
|
||||
/*
|
||||
Function: removeInventoryItem
|
||||
Description: Removes an active inventory item by marking it inactive
|
||||
after user selection.
|
||||
Parameter: None
|
||||
Return type: void
|
||||
*/
|
||||
void AdminMenu::removeInventoryItem()
|
||||
{
|
||||
util::clear();
|
||||
@@ -225,6 +276,13 @@ void AdminMenu::removeInventoryItem()
|
||||
util::pressEnter();
|
||||
}
|
||||
|
||||
/*
|
||||
Function: checkStockAvailability
|
||||
Description: Checks if a specific inventory item is available
|
||||
and displays its details if active.
|
||||
Parameter: None
|
||||
Return type: void
|
||||
*/
|
||||
void AdminMenu::checkStockAvailability()
|
||||
{
|
||||
util::clear();
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
/*
|
||||
File: AdminMenu.h
|
||||
Description: Header file declaring the AdminMenu class, which provides
|
||||
administrative operations such as inventory management,
|
||||
user management, service configuration, and notifications.
|
||||
Author: Trenser
|
||||
Date:19-May-2026
|
||||
*/
|
||||
#pragma once
|
||||
#include "Controller.h"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user