Skip to content

Commit d1ca264

Browse files
committed
Add lesson delete details in UG
1 parent 4c45e06 commit d1ca264

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

docs/DeveloperGuide.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,48 @@ The GUI then lists the filtered exercises.
265265

266266
Given below is the Sequence Diagram for interactions within the Logic component for the execute("find_exercises bench")
267267
API call.
268+
268269
![FindExercisesSequenceDiagram](images/FindExercisesSequenceDiagram.png)
269270

271+
### Delete lesson
272+
273+
The delete lesson feature is implemented using `LessonDeleteCommandParser`, as well as the following command:
274+
* `LessonDeleteCommand`, to be executed when the user inputs the command into fitNUS.
275+
276+
`LessonDeleteCommandParser` takes in the user input and parses them to return a `LessonDeleteCommand` object. The
277+
`LessonDeleteCommand` class then executes the command by deleting the lesson from the respective `FilteredList` for
278+
lessons in `ModelManager`.
279+
280+
Given below is an example usage scenario and how the delete lesson mechanism behaves at each step.
281+
282+
**Step 1:**
283+
284+
The user types into fitNUS `lesson_delete 1`.
285+
286+
**Step 2:**
287+
288+
This input is passed to `LogicManager` as a String and from there, the input is parsed by the `parseCommand`
289+
method of `FitNusParser`.
290+
291+
**Step 3:**
292+
293+
`parseCommand` identifies that this is a command to delete lesson, so it calls the `parse` method of
294+
`LessonDeleteCommandParser` on the input.
295+
296+
**Step 4:**
297+
298+
Within `parse`, the name of the lesson is produced by `ParserUtil` parsing the given argument. This method then creates
299+
the Lesson object.
300+
301+
**Step 5:**
302+
303+
`LogicManager` then calls the `execute` method of this returned `LessonDeleteCommand`.
304+
Within `execute`, `ModelManager`'s `updateFilteredLessonList` method is called. This removes the unwanted lesson.
305+
306+
**Step 6:**
307+
308+
The GUI then lists the deleted lesson.
309+
270310

271311

272312
--------------------------------------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)