Skip to content

Commit

Permalink
Merge pull request nus-cs2103-AY2021S1#89 from iqbxl/branch-update-DG
Browse files Browse the repository at this point in the history
Add Lesson delete details in DG
  • Loading branch information
khor-jingqian authored Oct 22, 2020
2 parents 4c45e06 + d1ca264 commit 549d972
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,48 @@ The GUI then lists the filtered exercises.

Given below is the Sequence Diagram for interactions within the Logic component for the execute("find_exercises bench")
API call.

![FindExercisesSequenceDiagram](images/FindExercisesSequenceDiagram.png)

### Delete lesson

The delete lesson feature is implemented using `LessonDeleteCommandParser`, as well as the following command:
* `LessonDeleteCommand`, to be executed when the user inputs the command into fitNUS.

`LessonDeleteCommandParser` takes in the user input and parses them to return a `LessonDeleteCommand` object. The
`LessonDeleteCommand` class then executes the command by deleting the lesson from the respective `FilteredList` for
lessons in `ModelManager`.

Given below is an example usage scenario and how the delete lesson mechanism behaves at each step.

**Step 1:**

The user types into fitNUS `lesson_delete 1`.

**Step 2:**

This input is passed to `LogicManager` as a String and from there, the input is parsed by the `parseCommand`
method of `FitNusParser`.

**Step 3:**

`parseCommand` identifies that this is a command to delete lesson, so it calls the `parse` method of
`LessonDeleteCommandParser` on the input.

**Step 4:**

Within `parse`, the name of the lesson is produced by `ParserUtil` parsing the given argument. This method then creates
the Lesson object.

**Step 5:**

`LogicManager` then calls the `execute` method of this returned `LessonDeleteCommand`.
Within `execute`, `ModelManager`'s `updateFilteredLessonList` method is called. This removes the unwanted lesson.

**Step 6:**

The GUI then lists the deleted lesson.



--------------------------------------------------------------------------------------------------------------------
Expand Down

0 comments on commit 549d972

Please sign in to comment.