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

Update List feature in DG with sequence diagram #82

Merged
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
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)
Copy link

Choose a reason for hiding this comment

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

Good representation of list feature


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