diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index c5740b3996..cd866bf59f 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -366,10 +366,11 @@ The steps command will specifically interact with the `stepList` in the supercla - `getstepssuggestions` will calculate the calories burnt based on the steps taken and the user's weight. It will then suggest how many more steps they need to take to meet their daily calorie goal. -The diagram below shows the class diagram to show the inheritance from the `Command` superclass: -![Step command class diagram](images/AddStepsCommand.png "Step command class diagram") +The below sequence diagram shows the sequence of the `addsteps` command: +![Sequence of adding steps](images/AddStepCommand-0.png) -The structure is very similar to the other commands albeit for a few attributes and the logic is implemented in the `execute()` method. +...and `deletesteps` command. +![Sequence of deleting steps](images/DeleteStepsCommand-0.png) ### 8. Handling an Invalid Input If user enters invalid input, the app uses `InvalidCommand` class to handle it. diff --git a/docs/diagrams/AddStepCommand.puml b/docs/diagrams/AddStepCommand.puml new file mode 100644 index 0000000000..c4de3d2bc4 --- /dev/null +++ b/docs/diagrams/AddStepCommand.puml @@ -0,0 +1,35 @@ +@startuml + +!include style.puml + +box Logic LOGIC_COLOR_T1 +participant ":LogicManager" as LogicManager LOGIC_COLOR +participant ":CommandParser" as CommandParser LOGIC_COLOR +participant ":AddStepsCommand" as AddStepsCommand LOGIC_COLOR +participant ":CommandResult" as CommandResult LOGIC_COLOR +end box + +box Model MODEL_COLOR_T1 +participant ":StepList" as StepList MODEL_COLOR +end box + +-> LogicManager ++: execute ("addsteps 200 d/2023-10-10") +LogicManager -> CommandParser ++: parseCommand("addsteps 200 d/2023-10-10") +create AddStepsCommand +CommandParser -> AddStepsCommand ++: +return +CommandParser -> AddStepsCommand ++: setArguments("200", userCommandLine:String) +return command:Command +return command:Command +LogicManager -> LogicManager ++: executeCommand() +LogicManager -> AddStepsCommand ++: execute() +AddStepsCommand -> StepList ++: addSteps(1) +return +create CommandResult +AddStepsCommand -> CommandResult ++: +return result +return result +return result +return + +@enduml \ No newline at end of file diff --git a/docs/diagrams/DeleteStepsCommand.puml b/docs/diagrams/DeleteStepsCommand.puml new file mode 100644 index 0000000000..9d05261577 --- /dev/null +++ b/docs/diagrams/DeleteStepsCommand.puml @@ -0,0 +1,35 @@ +@startuml + +!include style.puml + +box Logic LOGIC_COLOR_T1 +participant ":LogicManager" as LogicManager LOGIC_COLOR +participant ":CommandParser" as CommandParser LOGIC_COLOR +participant ":DeleteStepsCommand" as DeleteStepsCommand LOGIC_COLOR +participant ":CommandResult" as CommandResult LOGIC_COLOR +end box + +box Model MODEL_COLOR_T1 +participant ":StepList" as StepList MODEL_COLOR +end box + +-> LogicManager ++: execute ("deletesteps 1") +LogicManager -> CommandParser ++: parseCommand("deletesteps 1") +create DeleteStepsCommand +CommandParser -> DeleteStepsCommand ++: +return +CommandParser -> DeleteStepsCommand ++: setArguments("1", userCommandLine:String) +return command:Command +return command:Command +LogicManager -> LogicManager ++: executeCommand() +LogicManager -> DeleteStepsCommand ++: execute() +DeleteStepsCommand -> StepList ++: deleteSteps(1) +return +create CommandResult +DeleteStepsCommand -> CommandResult ++: +return result +return result +return result +return + +@enduml \ No newline at end of file diff --git a/docs/images/AddStepCommand-0.png b/docs/images/AddStepCommand-0.png new file mode 100644 index 0000000000..9d54a85cdc Binary files /dev/null and b/docs/images/AddStepCommand-0.png differ diff --git a/docs/images/AddStepsCommand.png b/docs/images/AddStepsCommand.png deleted file mode 100644 index c73a67078d..0000000000 Binary files a/docs/images/AddStepsCommand.png and /dev/null differ diff --git a/docs/images/DeleteStepsCommand-0.png b/docs/images/DeleteStepsCommand-0.png new file mode 100644 index 0000000000..a90dec0dbe Binary files /dev/null and b/docs/images/DeleteStepsCommand-0.png differ diff --git a/docs/team/farissirraj.md b/docs/team/farissirraj.md index 27750e6a38..e2ac9c9b4c 100644 --- a/docs/team/farissirraj.md +++ b/docs/team/farissirraj.md @@ -6,36 +6,41 @@ #### Key Contributions -* **Feature 1:** Steps Class +* **Steps Class** - Wrote the class for `Step` which was used to store the steps taken by the user as an object. - Wrote the methods to enable parsing, formatting and other operations required within the object. - Added on to the Parser and Storage classes to integrate this feature with the existing functionality of the codebase. -* **Feature 2:** Add and Delete steps +* **Add and Delete steps** - What it does: allows user to add in their steps and view their steps for the day. - Calculate the number of steps taken in a particular day. - Delete steps that were added by mistake. - Justification: this feature helps user to track their steps and compare it with their daily goals. -* **Feature 3:** List Steps +* **List Steps** - What it does: allows user to view the steps in a list. - Delete steps that were added by mistake. - Justification: Enables the user to better decide on what operation they want to do. For example, deleting a step uses the index in the list as a reference and viewing the list of steps will allow them to carefully select which entry to delete. -* **Feature 4:** Calculate the calories consumed +* **Calculate the calories consumed** - What it does: Calculate the calories consumed based on the meals eaten. - Justification: Allows the user to keep track of their fitness goals through the calories consumed from meals. -* **Feature 5:** Provide suggestions on how many more steps need to be walked to reach the daily calorie goal. +* **Calculate the total number of steps walked** + - What it does: Calculate the total number of steps walked in a given day. + - Justification: Allows the user to keep track of their daily step count. This will allow the user to analyse their walking habits just as they do for their meals and workouts. + + +* **Provide suggestions on how many more steps need to be walked to reach the daily calorie goal.** - What it does: Calculate the calories consumed based on the number of steps walked. - Justification: Allows the user to keep track of their calorie expenses through walking alone. -* **Feature 6:** Provide a suggestion on the ideal weight range for the user. +* **Provide a suggestion on the ideal weight range for the user.** - What it does: Calculates the ideal weight range for the user provided their height as entered in the user profile. - Justification: Allows the user to be mindful of their weight as they are on the journey to becoming fit. @@ -65,4 +70,5 @@ - Added documentation for the features `addsteps`, `deletesteps`, `viewsteps`, `caloriesconsumed`, `getstepssuggestion`, `totalsteps` and `checkrecommendedweight` to allow the new user to start using this project. - Developer Guide: - Documented my added features to the developer guide. - - Added documentation for the commands pertaining to the `Step` suite of commands which all inherit from the Command superclass to explain the functionality of the commands to another developer. \ No newline at end of file + - Added documentation for the commands pertaining to the `Step` suite of commands which all inherit from the Command superclass to explain the functionality of the commands to another developer. + - Added sequence diagrams for some of the commands to explain the flow of the code. \ No newline at end of file