Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add sequence diagram for tag function #111

Merged
merged 2 commits into from
Apr 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

'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
Loading