Skip to content

Commit

Permalink
Merge pull request AY2324S1-CS2103-T16-3#214 from sp4ce-cowboy/UniCas…
Browse files Browse the repository at this point in the history
…h-1.4/finalizeDeveloperGuide

[Documentation] DG Update with Delete, Clear, Reset, Get, Find, StyleSheet and UI Overview
  • Loading branch information
sp4ce-cowboy authored Nov 13, 2023
2 parents 23727ac + 8d54f11 commit 13719a1
Show file tree
Hide file tree
Showing 24 changed files with 920 additions and 152 deletions.
695 changes: 567 additions & 128 deletions docs/DeveloperGuide.md

Large diffs are not rendered by default.

10 changes: 2 additions & 8 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -607,8 +607,8 @@ of the transaction to be retrieved, as shown in the currently displayed `Transac
<div class="callout callout-info" markdown="span" style="margin-bottom: 20px;">
There are some important `INDEX` constraints for which you can refer to the
[command breakdown's Argument Types section](#argument-types). You can also refer to the
[UI Layout's Transaction Card section](#transaction-card) to learn about the transaction index values that
can change based on the current `Transactions List` configuration.
[UI Layout's Transaction Card section](DeveloperGuide.md#transaction-card) in the Developer Guide
to learn about the transaction index values that can change based on the current `Transactions List` configuration.
</div>

##### Successful Execution
Expand Down Expand Up @@ -1542,12 +1542,6 @@ It also cannot be followed with any arguments, options, or non-whitespace text.
</div>


<div class="callout callout-important" markdown="span" style="margin-bottom: 20px;">
This command is subject to the filter applied by `find` or `get_total_expenditure`
commands, which you can read about under the `find` command section [here](#find-transaction)
or under the `get_total_expenditure` command section [here](#get-total-expenditure).
</div>

<div class="callout callout-important" markdown="span" style="margin-bottom: 20px;">
While this command will restore the default UniCa$h transactions, the current `Transactions List`
configuration is still subject to any filters applied by `find` or `get_total_expenditure`,
Expand Down
9 changes: 8 additions & 1 deletion docs/diagrams/unicash/ClearTransactionsActivityDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,14 @@ start

: User enters clear_transactions command;

: All transactions have been cleared;
if () then ([command followed with trailing characters])
:Parse exception thrown;
stop

else ([else])
:All transactions cleared successfully;

endif

stop

Expand Down
34 changes: 29 additions & 5 deletions docs/diagrams/unicash/ClearTransactionsSequenceDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ skinparam ArrowFontStyle plain

box Logic LOGIC_COLOR_T1
participant ":LogicManager" as LogicManager LOGIC_COLOR
participant ":ClearTransactionsCommand" as ClearTransactionsCommand LOGIC_COLOR
participant ":UniCashParser" as UniCashParser LOGIC_COLOR
participant ":ClearTransactionsCommandParser" as ClearTransactionsCommandParser LOGIC_COLOR
participant "d:ClearTransactionsCommand" as ClearTransactionsCommand LOGIC_COLOR
participant ":CommandResult" as CommandResult LOGIC_COLOR
end box

Expand All @@ -15,14 +17,36 @@ end box
[-> LogicManager : execute("clear_transactions")
activate LogicManager

LogicManager -> UniCashParser : parseCommand("clear_transactions")
activate UniCashParser

create ClearTransactionsCommandParser
UniCashParser -> ClearTransactionsCommandParser
activate ClearTransactionsCommandParser

ClearTransactionsCommandParser --> UniCashParser
deactivate ClearTransactionsCommandParser

UniCashParser -> ClearTransactionsCommandParser : parse("")
activate ClearTransactionsCommandParser

create ClearTransactionsCommand
LogicManager -> ClearTransactionsCommand
ClearTransactionsCommandParser -> ClearTransactionsCommand
activate ClearTransactionsCommand

ClearTransactionsCommand --> LogicManager
ClearTransactionsCommand --> ClearTransactionsCommandParser :
deactivate ClearTransactionsCommand

LogicManager -> ClearTransactionsCommand : execute()
ClearTransactionsCommandParser --> UniCashParser :
deactivate ClearTransactionsCommandParser
'Hidden arrow to position the destroy marker below the end of the activation bar.
ClearTransactionsCommandParser -[hidden]-> UniCashParser
destroy ClearTransactionsCommandParser

UniCashParser --> LogicManager :
deactivate UniCashParser

LogicManager -> ClearTransactionsCommand : execute(model)
activate ClearTransactionsCommand

ClearTransactionsCommand -> Model : setUniCash(new UniCash())
Expand All @@ -38,7 +62,7 @@ activate CommandResult
CommandResult --> ClearTransactionsCommand
deactivate CommandResult

ClearTransactionsCommand --> LogicManager
ClearTransactionsCommand --> LogicManager : command result
deactivate ClearTransactionsCommand

[<--LogicManager
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ start
if () then ([else])
:Parse exception thrown;
stop
else ([Input is a valid number])
else ([command argument is a valid number])
:Transaction successfully deleted ;
endif

Expand Down
4 changes: 2 additions & 2 deletions docs/diagrams/unicash/DeleteTransactionSequenceDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ destroy DeleteTransactionCommandParser
UniCashParser --> LogicManager : d
deactivate UniCashParser

LogicManager -> DeleteTransactionCommand : execute()
LogicManager -> DeleteTransactionCommand : execute(model)
activate DeleteTransactionCommand

DeleteTransactionCommand -> Model : deleteTransaction (1)
DeleteTransactionCommand -> Model : deleteTransaction(transactionToDelete)
activate Model

Model --> DeleteTransactionCommand
Expand Down
47 changes: 47 additions & 0 deletions docs/diagrams/unicash/FindTransactionsActivityDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
@startuml
!pragma useVerticalIf on
skin rose
skinparam ActivityFontSize 15
skinparam ArrowFontSize 12
start

: User enters find command;

if () then (

[command not followed by any parameters])
:Error: Invalid command format;
stop


elseif () then (



[command followed by multiple
instances of the same parameter])

:Error: Multiple values specified for single-valued field ;
stop

elseif () then (


[command followed by
invalid parameters])

:Error: Invalid command format;
stop


else (

[else]
)
:Transaction retrieved successfully;

endif

stop

@enduml
73 changes: 73 additions & 0 deletions docs/diagrams/unicash/FindTransactionsSequenceDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@

@startuml
!include ../style.puml

box Logic LOGIC_COLOR_T1
participant ":LogicManager" as LogicManager LOGIC_COLOR
participant ":UniCashParser" as UniCashParser LOGIC_COLOR
participant ":FindCommandParser" as FindCommandParser LOGIC_COLOR
participant "command:FindCommand" as FindCommand LOGIC_COLOR
participant "commandResult:CommandResult" as CommandResult LOGIC_COLOR

end box

box Model MODEL_COLOR_T1
participant ":Model" as Model MODEL_COLOR
end box

[-> LogicManager : execute("find c/food")
activate LogicManager

LogicManager -> UniCashParser : parseCommand("find c/food")
activate UniCashParser

create FindCommandParser
UniCashParser -> FindCommandParser
activate FindCommandParser

FindCommandParser --> UniCashParser
deactivate FindCommandParser

UniCashParser -> FindCommandParser : parse("c/food")
activate FindCommandParser


create FindCommand
FindCommandParser -> FindCommand
activate FindCommand

FindCommand --> FindCommandParser
deactivate FindCommand

FindCommandParser --> UniCashParser : command
deactivate FindCommandParser

FindCommandParser -[hidden]-> UniCashParser
destroy FindCommandParser

UniCashParser --> LogicManager : command
deactivate UniCashParser

LogicManager -> FindCommand : command.execute(model)
activate FindCommand


FindCommand -> Model : updateFilteredTransactionList(transactionPredicate)
activate Model

Model --> FindCommand
deactivate Model

create CommandResult
FindCommand -> CommandResult
activate CommandResult

CommandResult --> FindCommand
deactivate CommandResult

FindCommand --> LogicManager : commandResult
deactivate FindCommand

[<--LogicManager : commandResult
deactivate LogicManager
@enduml
20 changes: 20 additions & 0 deletions docs/diagrams/unicash/GetTransactionActivityDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
@startuml

skin rose
skinparam ActivityFontSize 15
skinparam ArrowFontSize 12
start

: User enters get command;

if () then ([else])
:Parse exception thrown;
stop
else ([command argument is a valid number])
:Transaction successfully retrieved ;
endif


stop

@enduml
70 changes: 70 additions & 0 deletions docs/diagrams/unicash/GetTransactionSequenceDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
@startuml
!include ../style.puml
skinparam ArrowFontStyle plain

box Logic LOGIC_COLOR_T1
participant ":LogicManager" as LogicManager LOGIC_COLOR
participant ":UniCashParser" as UniCashParser LOGIC_COLOR
participant ":GetCommandParser" as GetCommandParser LOGIC_COLOR
participant "d:GetCommand" as GetCommand LOGIC_COLOR
participant ":CommandResult" as CommandResult LOGIC_COLOR
end box

box Model MODEL_COLOR_T1
participant ":Model" as Model MODEL_COLOR
end box

[-> LogicManager : execute("get 1")
activate LogicManager

LogicManager -> UniCashParser : parseCommand("get 1")
activate UniCashParser

create GetCommandParser
UniCashParser -> GetCommandParser
activate GetCommandParser

GetCommandParser --> UniCashParser
deactivate GetCommandParser

UniCashParser -> GetCommandParser : parse("1")
activate GetCommandParser

create GetCommand
GetCommandParser -> GetCommand
activate GetCommand

GetCommand --> GetCommandParser :
deactivate GetCommand

GetCommandParser --> UniCashParser :
deactivate GetCommandParser
'Hidden arrow to position the destroy marker below the end of the activation bar.
GetCommandParser -[hidden]-> UniCashParser
destroy GetCommandParser

UniCashParser --> LogicManager :
deactivate UniCashParser

LogicManager -> GetCommand : execute(model)
activate GetCommand

GetCommand -> Model : get(1)
activate Model

Model --> GetCommand
deactivate Model

create CommandResult
GetCommand -> CommandResult
activate CommandResult

CommandResult --> GetCommand
deactivate CommandResult

GetCommand --> LogicManager : result
deactivate GetCommand

[<--LogicManager
deactivate LogicManager
@enduml
21 changes: 21 additions & 0 deletions docs/diagrams/unicash/ResetUniCashActivityDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
@startuml

skin rose
skinparam ActivityFontSize 15
skinparam ArrowFontSize 12
start

: User enters reset_unicash command;

if () then ([command followed with trailing characters])
:Parse exception thrown;
stop

else ([else])
:UniCa$h successfully reset;

endif

stop

@enduml
Loading

0 comments on commit 13719a1

Please sign in to comment.