forked from nus-cs2103-AY1920S2/addressbook-level3
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #105 from beatricetay/planning-feature-list
Planning Feature
- Loading branch information
Showing
62 changed files
with
1,493 additions
and
227 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"plannedRecipes" : [ { | ||
"recipe" : { | ||
"name" : "Barley Pilaf", | ||
"time" : "50", | ||
"isFavourite" : true, | ||
"grains" : [ "0.5cup, small pieces of broken spaghetti" ], | ||
"vegetables" : [ "2.0tbsp, chives (chopped)", "50.0g, small onion (chopped)" ], | ||
"proteins" : [ "2.5cup, low-sodium chicken broth" ], | ||
"fruits" : [ ], | ||
"others" : [ "1.0cup, hulled barley", "10.0g, Salt & Pepper", "1.0tbsp, unsalted butter" ], | ||
"steps" : [ "Melt butter in saucepan over medium heat. Add onion and cook until soft and light golden brown.", "Add barley and stir until grains are coated in butter.", "Add broth and 0.5 tsp salt, bring to a boil.", "Reduce heat to medium low, cover, and simmer for 20mins.", "Uncover and quickly stir in spaghetti. Cover and continue to simmer, stirring occasionally.", "Once most liquid is absorbed and barley and spaghetti are tender, remove from hit and let sit.", "Season to taste with salt and pepper and sprinkle with chopped chives." ], | ||
"goals" : [ "Wholesome Wholemeal" ] | ||
}, | ||
"date" : "2020-02-02" | ||
}, { | ||
"recipe" : { | ||
"name" : "Asian BBQ Chicken", | ||
"time" : "15", | ||
"isFavourite" : false, | ||
"grains" : [ ], | ||
"vegetables" : [ "1.0tbsp, garlic & ginger (finely chopped)" ], | ||
"proteins" : [ "100.0g, chicken breast" ], | ||
"fruits" : [ ], | ||
"others" : [ "2.0tbsp, char siew sauce", "1.0tsp, honey", "1.0tsp, rice vinegar", "1.0tsp, Salt & pepper", "0.5tsp, sesame oil" ], | ||
"steps" : [ "In a bowl, mix all the ingredients to create marinade. Mix the chicken with the marinade.", "Pan sear the chicken from both sides.", "Serve with rice." ], | ||
"goals" : [ "Bulk like the Hulk" ] | ||
}, | ||
"date" : "2020-03-03" | ||
} ] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
src/main/java/seedu/recipe/logic/commands/ViewCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package seedu.recipe.logic.commands; | ||
|
||
import static java.util.Objects.requireNonNull; | ||
|
||
import seedu.recipe.logic.commands.exceptions.CommandException; | ||
import seedu.recipe.model.Model; | ||
import seedu.recipe.model.plan.PlannedRecipeWithinDateRangePredicate; | ||
|
||
/** | ||
* Schedules a recipe to a date. | ||
*/ | ||
|
||
public class ViewCommand extends Command { | ||
|
||
public static final String COMMAND_WORD = "view"; | ||
|
||
public static final String MESSAGE_USAGE = COMMAND_WORD + ": Views the planned recipes in the specified format."; | ||
|
||
public static final String MESSAGE_SUCCESS = "View format changed to %1$s"; | ||
|
||
private final PlannedRecipeWithinDateRangePredicate predicate; | ||
|
||
private final String type = "week"; // change to enum types? | ||
|
||
/** | ||
* Creates an ViewCommand to set the view of the planned recipes. | ||
*/ | ||
public ViewCommand(PlannedRecipeWithinDateRangePredicate predicate) { | ||
requireNonNull(predicate); | ||
this.predicate = predicate; | ||
} | ||
|
||
@Override | ||
public CommandResult execute(Model model) throws CommandException { | ||
requireNonNull(model); | ||
|
||
model.updateFilteredPlannedList(predicate); | ||
model.commitRecipeBook(); | ||
return new CommandResult(String.format(MESSAGE_SUCCESS, type)); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.