Skip to content

Commit

Permalink
Merge pull request #82 from isaaceng7/update-developer-guide
Browse files Browse the repository at this point in the history
Update List feature in DG with sequence diagram
  • Loading branch information
isaaceng7 committed Apr 4, 2024
2 parents 886bcfb + 1966121 commit d9b01e6
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 5 deletions.
15 changes: 10 additions & 5 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,18 @@ The following sequence diagram illustrates the sequence of interactions involved
![](./uml/uml-images/processEditTransactionDiagram.png)

### [Implemented] List feature
### Description
The list feature allows users to view their existing transactions. This feature includes viewing all the transactions,
past week's transactions, past month's transactions and transactions from a specified date range.

#### Implementation
The list feature in the BudgetBuddy application allows users to view all their past transactions. This feature is
facilitated through the `UserInterface#printAllTransactions`, which loops through the entire ArrayList of transactions
and extract all the details of each transaction.
This feature is facilitated through the `TransactionList#processList`, where it prompts the user for their choice of
list they wish to see. After the user inputs the choice, the get functions will store the transactions in a new
ArrayList and `UserInterface#printPastTransactions` will handle the output of the list.

This feature will be further enhanced to include options to view transactions that the user is interested in only. For
example, transactions of the past week, past month, specified date range.
Sequence Diagram
The following sequence diagram illustrates the sequence of interactions involved in the editing of a transaction:
![](./uml/uml-images/processList.png)

## Product scope
### Target user profile
Expand Down
Binary file added docs/uml/uml-images/processList.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
61 changes: 61 additions & 0 deletions docs/uml/uml-images/processList.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
@startuml
'https://plantuml.com/sequence-diagram

autonumber

actor User
participant "TransactionManager" as TM
participant "UserInterface" as UI
participant "LocalDate" as LD

User -> TM: processList()
TM -> UI: printListOptions()
activate UI
UI --> User: Display list options
deactivate UI
User -> TM: selectOption(option)
TM -> TM: determineAction(option)

alt Option 1 (All Transactions)
TM -> TM: printTransactions()
TM -> UI: printTransactions()
activate UI
UI --> User: Display all transactions
deactivate UI
else Option 2 (Past Week Transactions)
TM -> LD: now()
activate LD
LD --> TM: today
deactivate LD
TM -> TM: calculateStartDate("week")
TM -> TM: filterTransactions(startDate)
TM -> UI: printPastTransactions(transactions, "week")
activate UI
UI --> User: Display past week transactions
deactivate UI
else Option 3 (Past Month Transactions)
TM -> LD: now()
LD --> TM: today
TM -> TM: calculateStartDate("month")
TM -> TM: filterTransactions(startDate)
TM -> UI: printPastTransactions(transactions, "month")
activate UI
UI --> User: Display past month transactions
deactivate UI
else Option 4 (Custom Date Transactions)
TM -> UI: getStartDate()
activate UI
UI --> TM: startDate
deactivate UI
TM -> UI: getEndDate()
activate UI
UI --> TM: endDate
deactivate UI
TM -> TM: parseDates(startDate, endDate)
TM -> TM: filterTransactions(startDate, endDate)
TM -> UI: printCustomDateTransactions(transactions)
activate UI
UI --> User: Display custom date transactions
deactivate UI
end
@enduml

0 comments on commit d9b01e6

Please sign in to comment.