PantryPal is an all-in-one application designed to help students manage their meals. The application allows users to keep track of their ingredients, automatically generate shopping lists, plan their meals, and store recipes.
I contributed to all the code related to the Ingredient Inventory feature, which includes both core functionality and testing. This includes:
Ingredient Class: Representing individual ingredients, this class stores information such as ingredient name, quantity, unit, and category. It provides methods for managing ingredient attributes and ensures consistency in the entire ingredient management system.
Unit Enumerator: This enumerator defines all possible units for ingredients (e.g. kg, g, ml, oz), ensuring consistent handling of ingredient quantities across the project. It simplifies unit conversions and ensures the system is scalable.
Category Enumerator: This enumerator defines categories for ingredients (e.g. Dairy, Condiments, Spices), allowing for better organization, searching, and filtering of ingredients within the inventory.
IngredientInventory Class: This class is the main component of the Ingredient Inventory system. It manages a collection of ingredients, supporting features such as adding, editing, removing ingredients, and checking for low-stock alerts. It also includes methods for handling unit conversions and filtering ingredients by category.
Testing IngredientInventory: I created and maintained JUnit tests to ensure all functionalities of the Ingredient Inventory were thoroughly tested. This includes testing adding, removing, updating ingredients, managing low-stock alerts, unit conversion, and category filtering.
Comand Class: I made slight adjustments to the existing Inventory Command Class to ensure it integrates seamlessly with my code. This involved adjusting how messages are displayed in the CLI, improving the clarity and accuracy of feedback for the user.
I made sure all components worked smoothly together with the rest of the project, ensuring modularity and coherence across the entire application.
What it does:
Introduces a standardized enumeration for units (e.g., ML, GRAM, KG, LITRE), allowing consistent and validated unit usage throughout the Ingredient Inventory system.
Why it is implemented that way:
Enumerations reduce the risk of invalid or inconsistent unit strings, simplify unit-related operations (like conversion), and improve code readability and maintainability.
Highlights:
What it does:
Implements a system to convert between specific units: milligrams (mg), grams (g), and kilograms (kg); milliliters (ml) and liters (l); and cups, ounces, and pounds. This enables consistent quantity management and user flexibility.
Why it is implemented that way:
To ensure accurate conversions and flexibility when users input or update ingredients using these common unit categories, allowing smooth conversions within each unit type.
Highlights:
What it does:
Defines a fixed list of ingredient categories (e.g. Dairy, Spice, Condiments) through an enumeration, ensuring consistent categorization across the system.
Why it is implemented that way:
Using an enumerator enforces a fixed unit category, improving filtering, user input validation, and display consistency.
Highlights:
What it does:
Allows users to filter and display ingredients based on their assigned category.
Why it is implemented that way:
To improve usability by letting users quickly find and manage ingredients belonging to a specific group, especially useful in large inventories.
Highlights:
viewIngredientsByCategory <category>
.