Initial CRC (for part 2) - CMPUT301F22T03/JoyfulMealPlanning GitHub Wiki
Model Classes
Ingredient
| Responsibilities | Collaborators |
|---|---|
| Maintain details of an ingredient: brief description, best before date, location, amount, unit, ingredient category |
Recipe
| Responsibilities | Collaborators |
|---|---|
| Maintain details of a recipe: title, preparation time, number of servings, recipe category, comments, photograph, list of ingredients | Photo |
Meal Plan
| Responsibilities | Collaborators |
|---|---|
| Maintain details of a meal plan: title, list of recipes, amount of each recipe, list of ingredients | Recipe |
| Ingredient |
Photo
| Responsibilities | Collaborators |
|---|---|
| Holds data for a digital image |
Controller Classes
Ingredient Controller
| Responsibilities | Collaborators |
|---|---|
| Hold a local list of Ingredient | Ingredient |
| Synchronize with ingredient database | Ingredient DB Controller |
| The list can be sorted using Ingredient description, best before date, location, and ingredient category | |
| Return each individual Ingredient inside the list |
Ingredient DB Controller
| Responsibilities | Collaborators |
|---|---|
| Add an Ingredient to FireStore DB | Ingredient |
| Remove an Ingredient in FireStore DB | |
| Update an existing Ingredient in FireStore DB | |
| Return each Ingredient stored inside the DB |
Recipe Controller
| Responsibilities | Collaborators |
|---|---|
| Hold a local list of Recipe | Recipe |
| Synchronize with recipe database | Recipe DB Controller |
| The list can be sorted using Recipe title, preparation time, number of servings, or recipe category | |
| Return each individual Recipe inside the list |
Recipe DB Controller
| Responsibilities | Collaborators |
|---|---|
| Add a Recipe to FireStore DB | Recipe |
| Remove a Recipe in FireStore DB | |
| Update an existing Recipe in FireStore DB | |
| Return each Recipe stored inside the DB |
Meal Plan Controller
| Responsibilities | Collaborators |
|---|---|
| Hold a local list of Meal Plan | Meal Plan |
| Synchronize with meal plan database | Meal Plan DB Controller |
| The list can be sorted using Recipe title, preparation time, number of servings, or recipe category | |
| Return each individual Meal Plan inside the list |
Meal Plan DB Controller
| Responsibilities | Collaborators |
|---|---|
| Add a Meal Plan to FireStore DB | Meal Plan |
| Return each Meal Plan stored inside the DB |
Shopping List Controller
| Responsibilities | Collaborators |
|---|---|
| Create a shopping list that holds the needed Ingredient and the amount of each Ingredient | Ingredient |
| Get the ingredients and their counts from each Meal Plan inside Meal Plan Controller | Meal Plan |
| Get each Ingredient inside Ingredient Controller and its count | Ingredient Controller |
| Calculate the difference between ingredient counts | Meal Plan Controller |
| The list can be sorted using Ingredient description or category |
Photo Controller
| Responsibilities | Collaborators |
|---|---|
| Lets the user select a photo from the file path and store it as a Photo object | Photo |
| Lets the user delete or replace an existing Photo | |
| Attaches the photo to Recipe |
View Classes
Ingredients Activity
| Responsibilities | Collaborators |
|---|---|
| Displays the local ingredients list | Ingredient Controller |
| Allows the user to add an Ingredient | |
| Allows the deletion of existing ingredient(s) |
Recipe Activity
| Responsibilities | Collaborators |
|---|---|
| Displays the existing list of recipes | Recipe Controller |
| Allows the user to add a new Recipe | |
| Allows the deletion of existing recipe(s) | |
| Attaches the photo to Recipe |
Meal Plan Activity
| Responsibilities | Collaborators |
|---|---|
| Allows the user to add a new Meal Plan, choosing from either ingredients storage or recipes | Meal Plan Controller |
| Displays the existing list of recipes | Recipe Controller |
| Displays the existing ingredients list | Ingredient Controller |
Shopping List Activity
| Responsibilities | Collaborators |
|---|---|
| Displays the shopping list | Shopping List Controller |
| Displays the existing ingredients list | Ingredient Controller |
| Allows the user to view details of an Ingredient | |
| Allows the user to store ingredients in the ingredient storage |