<UserStory> INV003: Remove Stock </UserStory>
<Changes>
1. Integrated InventoryManagementService into Controller to handle removal of inventory items.
2. Implemented InventoryManagementService::removeInventoryItem to mark items as INACTIVE in the datastore.
3. Enhanced AdminMenu with removeInventoryItem workflow:
- Displays inventory list with index, ID, part name, quantity, and price.
- Allows admin to select item by index for removal.
- Provides confirmation message after successful deletion.
4. Added static helper function displayInventoryWithItems in AdminMenu for modularized inventory display.
</Changes>
<Test>
Precondition:
1. Admin user is logged into the system.
2. Inventory contains multiple items with unique IDs.
3. DataStore is initialized and accessible.
Steps:
1. Navigate to Admin Menu and select "Remove Inventory Item".
- Verify that the system displays all inventory items with ID, part name, quantity, and price.
2. Select an item by entering its index.
- Verify that the system removes the item and displays a confirmation message.
3. Attempt to remove an item with an invalid index.
- Verify that the system rejects the input and shows an error message.
4. Navigate to "View Stock Levels".
- Verify that the removed item no longer appears in the inventory list.
</Test>
<Review>
Sreeja Reghukumar
</Review>
- Removed observer map from Subject base class
- Removed notify() from Subject interface
- Made NotificationManagementService abstract with pure virtual methods
- Added static observer maps to notification service implementations
- Added attach() and detach() overrides in inventory, payment, and service management services
- Added update() override in User model for observer pattern support
- Updated notification method declarations with override specifiers
<Changes>
1. Added State enum with ACTIVE and INACTIVE values in Enums.h.
2. Added state member, getter, and setter in User, Service, InventoryItem, and ComboPackage models.
3. Updated constructors to initialize model objects with ACTIVE state by default.
4. Added state string conversion helper functions in Enums.h.
5. Added default return values in Controller getter methods to complete stub implementations.
6. Added basic menu loop implementation in CustomerMenu and TechnicianMenu for handling user input.
</Changes>
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