diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index 98ea0ab86a3..3dcaea86494 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -158,6 +158,27 @@ Classes used by multiple components are in the `seedu.address.commons` package. This section describes some noteworthy details on how certain features are implemented. +### List Transactions `listt INDEX` + +#### Implementation + +The list transactions command allows for users to view all transactions for the specified person. Notably, when the command is used, `Model#updateFilteredPersonList()` is called to update the person list to just contain that specified person. It also implements the following operations: + +* `Model#setIsViewTransactions(boolean)` — Displays the person list in the GUI when false, and displays the transactions list in the GUI when true. +* `Model#updateTransactionList(ObservableList)` — Updates the transaction list to contain transactions for the specified person. + +The following sequence diagram shows an example execution of command `listt 1`. + + + +#### Side Effects + +As a result of `listt INDEX` changing the person list, operations on the transactions (e.g. `deletet` and `summary`) can now be performed on the transactions list, without specifying the person index. + +The following activity diagram shows how the user should use some of our transaction-related commands. + + + ### \[Proposed\] Undo/redo feature #### Proposed Implementation diff --git a/docs/diagrams/ListTransactionsActivityDiagram.puml b/docs/diagrams/ListTransactionsActivityDiagram.puml new file mode 100644 index 00000000000..09610ccd485 --- /dev/null +++ b/docs/diagrams/ListTransactionsActivityDiagram.puml @@ -0,0 +1,22 @@ +@startuml +skin rose +skinparam ActivityFontSize 15 +skinparam ArrowFontSize 12 +start +:User executes listt command; +:Model updates person list; +:GUI displays transactions list; + +'Since the beta syntax does not support placing the condition outside the +'diamond we place it as the true branch instead. + +if () then ([execute deletet command]) + :Delete transaction; + :Model updates transaction list; +else([execute summary command]) + :Model filters transaction list; +endif + +:GUI displays transaction list; +stop +@enduml diff --git a/docs/diagrams/ListTransactionsDiagram.puml b/docs/diagrams/ListTransactionsDiagram.puml new file mode 100644 index 00000000000..66d67303f51 --- /dev/null +++ b/docs/diagrams/ListTransactionsDiagram.puml @@ -0,0 +1,58 @@ +@startuml +!include style.puml +skinparam ArrowFontStyle plain + +box Logic LOGIC_COLOR_T1 +participant ":LogicManager" as LogicManager LOGIC_COLOR +participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR +participant "t:ListTransactionCommand" as ListTransactionCommand LOGIC_COLOR +end box + +box Model MODEL_COLOR_T1 +participant ":Model" as Model MODEL_COLOR +end box +[-> LogicManager : execute(listt 1) +activate LogicManager + +LogicManager -> AddressBookParser : parseCommand(listt 1)) +activate AddressBookParser + +create ListTransactionCommand +AddressBookParser -> ListTransactionCommand +activate ListTransactionCommand + +ListTransactionCommand --> AddressBookParser +deactivate ListTransactionCommand + +AddressBookParser --> LogicManager : t +deactivate AddressBookParser + +LogicManager -> ListTransactionCommand : execute() +activate ListTransactionCommand + +ListTransactionCommand -> Model : updateFilteredPersonList() +activate Model + +Model --> ListTransactionCommand +deactivate Model + +ListTransactionCommand -> Model : setViewTransactions(true) +activate Model + +Model --> ListTransactionCommand +deactivate Model + +ListTransactionCommand -> Model : updateTransactionList() +activate Model + +Model --> ListTransactionCommand +deactivate Model + +ListTransactionCommand --> LogicManager : result +deactivate ListTransactionCommand +ListTransactionCommand -[hidden]-> LogicManager : result +destroy ListTransactionCommand + +[<--LogicManager +deactivate LogicManager +@enduml