Skip to content

Commit

Permalink
Merge pull request #111 from ChenKangg/master
Browse files Browse the repository at this point in the history
add sequence diagram for tag function
  • Loading branch information
EugeneChanJiajun committed Apr 1, 2024
2 parents 8739d51 + 562cac6 commit 51b5648
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@ Step 2. After the user has added new travel activities into the `travelActivityL

Step 3. The method will loop through each activity in `travelActivities` and add up all the expenses.

### Tag feature

The tag feature is implemented through the tagCommand method, which allows users to add tags to specific travel activities stored in the system.

The sequence diagram depicts the interaction between the user, the tagCommand method, the TravelActivityList instance, and the OmniException instance.

![TagSequenceDiagram.png](TagSequenceDiagram.png)

## Product scope
### Target user profile

Expand Down
Binary file added docs/TagSequenceDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions docs/team/TagSequenceDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
@startuml
'https://plantuml.com/sequence-diagram

actor User

participant "tagCommand(line: String, list: TravelActivityList)" as tagCommandMethod
participant "list: TravelActivityList" as TravelActivityListInstance
participant "OmniExceptionInstance: OmniException" as OmniExceptionInstance

User -> tagCommandMethod: tagCommand(line, list)
activate tagCommandMethod

tagCommandMethod -> tagCommandMethod: line.split(" ")
alt command.length == 3 && isNumeric(command[1])
tagCommandMethod -> tagCommandMethod: int listNumber = Integer.parseInt(command[1])
tagCommandMethod -> tagCommandMethod: String tag = command[2]
tagCommandMethod -> TravelActivityListInstance: tagActivity(listNumber, tag)
else command.length == 2
tagCommandMethod -> OmniExceptionInstance: OmniException("Please specify a tag name")
else
tagCommandMethod -> OmniExceptionInstance: OmniException("Please specify which task to tag")
end

deactivate tagCommandMethod
@enduml

0 comments on commit 51b5648

Please sign in to comment.