Skip to content

Commit

Permalink
Merge pull request #382
Browse files Browse the repository at this point in the history
Add UML diagram for mark command
  • Loading branch information
currynia authored Nov 12, 2024
2 parents d19d4f4 + aa27781 commit f48695d
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
16 changes: 16 additions & 0 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,22 @@ Note: While the diagram shows the lifeline of objects even after their deletion,
2. KonTActs will create a contact of Tom with the given details before adding it to the contact list.
3. The contact is then displayed in the UI, along with a success message.


### MarkCommand

<puml src="diagrams/MarkCommandActivityDiagram.puml" width="750" />


* The `MarkCommand` is used by KonTActs to allow TAs to mark the attendance for a student.
* It follows the activity diagram as shown above where it first checks if the person exists.
* If the person exists, it will check if the weeksPresent contains the week to be marked.
* If the weeksPresent does not contain the week to be marked yet, it will add it in and return a success message. Else it will throw a mark already success message to tell the TA that the attendance for the TA for that week has been marked.

**Example Usage**
1. User inputs the command "mark n/John Doe w/1".
2. KonTActs will set the week 1 attendance for John Doe to be true.
3. The update is then displayed in the UI, along with a success message.

---

### Command History implementation
Expand Down
23 changes: 23 additions & 0 deletions docs/diagrams/MarkCommandActivityDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
@startuml
start
:User keys in MarkCommand with name and week;

:Retrieve person from Model using name;

if () then ([Person not found])
:Throw MESSAGE_INVALID_PERSON_DISPLAYED_NAME;
stop
else ([Else])
:Retrieve weeksPresent for the person;
if () then ([Week already marked])
:Return MESSAGE_MARK_ALREADY_SUCCESS;
stop
else ([Else])
:Add week to weeksPresent;
:Update person with new weeksPresent;
:Save updated person back to Model;
:Return MESSAGE_MARK_SUCCESS;
stop
endif
endif
@enduml

0 comments on commit f48695d

Please sign in to comment.