Skip to content

Commit

Permalink
Merge pull request #237 from annnniexu/master
Browse files Browse the repository at this point in the history
fixed totalexpense diagram
  • Loading branch information
daryltay415 committed Apr 15, 2024
2 parents 5c924d3 + 5536ba8 commit 31bc348
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ 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 for the given type. If no type is provided, it will default to TravelActivity type.

![totalexpense.png](DiagramImages/totalexpense.png)
![TotalExpenseDiagram.png](DiagramImages/TotalExpenseDiagram.png)

### Tag feature

Expand Down
Binary file added docs/DiagramImages/TotalExpenseDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions docs/plantUML diagrams/totalexpense.puml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,26 @@
autonumber
actor User
User -> OmniTravel : "totalexpense /type Food"
activate OmniTravel
OmniTravel -> Parser : totalExpenseCommand(line, list)
activate Parser
Parser -> TravelActivityList : totalExpense(type)
activate TravelActivityList
loop size of travelActivities ArrayList
opt activity type matches the type the user inputed
TravelActivityList -> TravelActivity: getExpense()
activate TravelActivity
TravelActivity --> TravelActivityList:
deactivate TravelActivity
TravelActivityList -> TravelActivityList: total += expense

end
end

TravelActivityList --> Parser
deactivate TravelActivityList
Parser --> OmniTravel
deactivate Parser
OmniTravel --> User
deactivate OmniTravel
@enduml

0 comments on commit 31bc348

Please sign in to comment.