diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index bad6233473..8567ca8185 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -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 diff --git a/docs/TagSequenceDiagram.png b/docs/TagSequenceDiagram.png new file mode 100644 index 0000000000..909fd9bb8b Binary files /dev/null and b/docs/TagSequenceDiagram.png differ diff --git a/docs/team/TagSequenceDiagram.puml b/docs/team/TagSequenceDiagram.puml new file mode 100644 index 0000000000..64de501121 --- /dev/null +++ b/docs/team/TagSequenceDiagram.puml @@ -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 \ No newline at end of file