diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index bf8996a7dd..0ff730e0bf 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -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 diff --git a/docs/uml/uml-images/processList.png b/docs/uml/uml-images/processList.png new file mode 100644 index 0000000000..b32f2de2a6 Binary files /dev/null and b/docs/uml/uml-images/processList.png differ diff --git a/docs/uml/uml-images/processList.puml b/docs/uml/uml-images/processList.puml new file mode 100644 index 0000000000..4dbf26aaa0 --- /dev/null +++ b/docs/uml/uml-images/processList.puml @@ -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 \ No newline at end of file