Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/AY2122S1-CS2103T-W08-3/tp
Browse files Browse the repository at this point in the history
…into addorder-bugfix

# Conflicts:
#	docs/UserGuide.md
#	docs/images/TotalOrdersWindow.png
  • Loading branch information
lwlshawn committed Nov 7, 2021
2 parents 9370da1 + eebc7d1 commit c77588d
Show file tree
Hide file tree
Showing 69 changed files with 1,972 additions and 255 deletions.
378 changes: 320 additions & 58 deletions docs/DeveloperGuide.md

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -419,8 +419,10 @@ Press the ESCAPE key to close the total orders window
</div>

<div markdown="block" class="alert alert-info">
:information_source: The total orders displayed are based on the clients in the application. However clients without
orders in SalesNote will not be shown.
:information_source:

* Clients without orders will not be displayed.
* After adding/deleting orders, you might want to run this command again to refresh the window.
</div>

![TotalOrdersWindow](images/TotalOrdersWindow.png)
Expand Down
96 changes: 96 additions & 0 deletions docs/diagrams/SortOrderCommandSequenceDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
@startuml

!include style.puml

box Logic LOGIC_COLOR_T1
participant ":LogicManager" as LogicManager LOGIC_COLOR
participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR
participant ":SortOrderCommandParser" as SortOrderCommandParser LOGIC_COLOR
participant ":SortDescriptor" as SortDescriptor LOGIC_COLOR
participant "<<class>>\nParserUtil" as ParserUtil LOGIC_COLOR
participant "d:SortOrderCommand" as SortOrderCommand 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("sortorder f/a o/asc")
activate LogicManager

LogicManager -> AddressBookParser : parseCommand("sortorder f/a o/asc")
activate AddressBookParser

create SortOrderCommandParser
AddressBookParser -> SortOrderCommandParser
activate SortOrderCommandParser

SortOrderCommandParser --> AddressBookParser
deactivate SortOrderCommandParser

AddressBookParser -> SortOrderCommandParser : parse("f/a o/asc")
activate SortOrderCommandParser


SortOrderCommandParser -> ParserUtil : parseSortField("a")
activate ParserUtil

ParserUtil --> SortOrderCommandParser : sortField
deactivate ParserUtil

SortOrderCommandParser -> ParserUtil : parseSortOrdering("asc")
activate ParserUtil

ParserUtil --> SortOrderCommandParser : sortOrdering
deactivate ParserUtil

create SortDescriptor
SortOrderCommandParser -> SortDescriptor : SortDescriptor(sortField, sortOrdering)
activate SortDescriptor

SortDescriptor --> SortOrderCommandParser : sortDescriptor
deactivate SortDescriptor

create SortOrderCommand
SortOrderCommandParser -> SortOrderCommand : SortOrderCommand(sortDescriptor)
activate SortOrderCommand

SortOrderCommand --> SortOrderCommandParser : sortOrderCommand
deactivate SortOrderCommand

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

AddressBookParser --> LogicManager : sortOrderCommand
deactivate AddressBookParser

LogicManager -> SortOrderCommand : execute()
activate SortOrderCommand

SortOrderCommand -> Model : sortOrderList(SortDescriptor)
activate Model

Model --> SortOrderCommand
deactivate Model

create CommandResult
SortOrderCommand -> CommandResult
activate CommandResult

CommandResult --> SortOrderCommand
deactivate CommandResult

SortOrderCommand --> LogicManager : result
deactivate SortOrderCommand

[<--LogicManager
deactivate LogicManager
@enduml




24 changes: 24 additions & 0 deletions docs/diagrams/SortOrdersCommandClassDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
@startuml
'https://plantuml.com/class-diagram

@startuml
!include style.puml
skinparam arrowThickness 1.1
skinparam arrowColor LOGIC_COLOR_T4
skinparam classBackgroundColor LOGIC_COLOR

Class "{abstract}\nCommand" as Command
Interface Parser <<Interface>>


SortOrdersCommandParser ..> SortOrdersCommand : creates >
SortOrdersCommandParser .up.|> Parser
SortOrdersCommand -up-|> Command
SortOrdersCommand *--> SortDescriptor
SortDescriptor .up.|> "Comparator<Order>"
SortDescriptor *--> SortField
SortDescriptor *--> SortOrdering

@enduml


70 changes: 70 additions & 0 deletions docs/diagrams/SortOrdersModelSequenceDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
@startuml

!include style.puml

box Logic LOGIC_COLOR_T1
participant "d:SortOrdersCommand" as SortOrdersCommand LOGIC_COLOR
participant ":CommandResult" as CommandResult LOGIC_COLOR
end box

box Model MODEL_COLOR_T1
participant ":Model" as Model MODEL_COLOR
participant ":OrderBook" as OrderBook MODEL_COLOR
participant ":OrderList" as OrderList MODEL_COLOR
participant ":OrderList" as OrderList MODEL_COLOR
participant ":ObservableList<Order>" as ObservableList MODEL_COLOR
end box


-> SortOrdersCommand : execute()
activate SortOrdersCommand

SortOrdersCommand -> Model : sortOrderList(sortDescriptor)
activate Model

Model -> OrderBook : sortOrders(sortDescriptor)
activate OrderBook

OrderBook -> OrderList : sort(sortDescriptor)

activate OrderList

OrderList -> ObservableList : sort(sortDescriptor)

activate ObservableList

ObservableList --> OrderList

deactivate ObservableList

OrderList --> OrderBook

deactivate OrderList


OrderBook --> Model

deactivate OrderBook

Model --> SortOrdersCommand

deactivate Model



create CommandResult
SortOrdersCommand -> CommandResult
activate CommandResult

CommandResult --> SortOrdersCommand : result
deactivate CommandResult



[<--SortOrdersCommand : result
deactivate SortOrdersCommand
@enduml




66 changes: 66 additions & 0 deletions docs/diagrams/SortOrdersParserSequenceDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
@startuml

!include style.puml

box Logic LOGIC_COLOR_T1
participant ":SalesNoteParser" as SalesNoteParser LOGIC_COLOR
participant ":SortOrdersCommandParser" as SortOrdersCommandParser LOGIC_COLOR
participant ":SortDescriptor" as SortDescriptor LOGIC_COLOR
participant "<<class>>\nParserUtil" as ParserUtil LOGIC_COLOR
participant "d:SortOrdersCommand" as SortOrderCommand LOGIC_COLOR
end box

-> SalesNoteParser : parseCommand("sortorders f/a o/asc")
activate SalesNoteParser

create SortOrdersCommandParser
SalesNoteParser -> SortOrdersCommandParser
activate SortOrdersCommandParser

SortOrdersCommandParser --> SalesNoteParser
deactivate SortOrdersCommandParser

SalesNoteParser -> SortOrdersCommandParser : parse("f/a o/asc")
activate SortOrdersCommandParser

SortOrdersCommandParser -> ParserUtil : parseSortField("a")
activate ParserUtil

ParserUtil --> SortOrdersCommandParser : sortField
deactivate ParserUtil

SortOrdersCommandParser -> ParserUtil : parseSortOrdering("asc")
activate ParserUtil

ParserUtil --> SortOrdersCommandParser : sortOrdering
deactivate ParserUtil

create SortDescriptor
SortOrdersCommandParser -> SortDescriptor : SortDescriptor(sortField, sortOrdering)
activate SortDescriptor

SortDescriptor --> SortOrdersCommandParser : sortDescriptor
deactivate SortDescriptor

create SortOrderCommand
SortOrdersCommandParser -> SortOrderCommand : SortOrderCommand(sortDescriptor)
activate SortOrderCommand

SortOrderCommand --> SortOrdersCommandParser : sortOrdersCommand
deactivate SortOrderCommand

SortOrdersCommandParser --> SalesNoteParser : sortOrdersCommand
deactivate SortOrdersCommandParser

'Hidden arrow to position the destroy marker below the end of the activation bar.
SortOrdersCommandParser -[hidden]-> SalesNoteParser
destroy SortOrdersCommandParser

<-- SalesNoteParser : sortOrdersCommand
deactivate SalesNoteParser

@enduml




42 changes: 42 additions & 0 deletions docs/diagrams/TotalOrdersSequenceDiagram1.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
@startuml
!include style.puml

box Logic LOGIC_COLOR_T1
participant ":LogicManager" as LogicManager LOGIC_COLOR
participant ":SalesNoteParser" as SalesNoteParser LOGIC_COLOR
participant "TotalOrdersCommand" as TotalOrdersCommand LOGIC_COLOR
participant "CommandResult" as CommandResult LOGIC_COLOR
end box

[-> LogicManager : execute("totalorders")
activate LogicManager

LogicManager -> SalesNoteParser : parseCommand("totalorders")
activate SalesNoteParser

create TotalOrdersCommand
SalesNoteParser -> TotalOrdersCommand
activate TotalOrdersCommand

TotalOrdersCommand --> SalesNoteParser
deactivate TotalOrdersCommand

SalesNoteParser --> LogicManager
deactivate SalesNoteParser

LogicManager -> TotalOrdersCommand : execute()
activate TotalOrdersCommand

create CommandResult
TotalOrdersCommand -> CommandResult
activate CommandResult

CommandResult --> TotalOrdersCommand
deactivate CommandResult

TotalOrdersCommand --> LogicManager
deactivate TotalOrdersCommand

[<--LogicManager
deactivate LogicManager
@enduml
42 changes: 42 additions & 0 deletions docs/diagrams/TotalOrdersSequenceDiagram2.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
@startuml
!include style.puml

box UI UI_COLOR_T1
participant ":MainWindow" as MainWindow UI_COLOR
participant ":TotalOrdersWindow" as TotalOrdersWindow UI_COLOR
end box

box Logic LOGIC_COLOR_T1
participant ":Logic" as Logic LOGIC_COLOR
end box

[-> MainWindow : executeCommand("totalorders")
activate MainWindow

MainWindow -> Logic : execute("totalorders")
activate Logic

Logic --> MainWindow
deactivate Logic

MainWindow -> MainWindow : handleTotalOrders()
activate MainWindow

MainWindow -> TotalOrdersWindow : reloadData()
activate TotalOrdersWindow

TotalOrdersWindow -> Logic : getClientTotalOrders()
activate Logic

Logic --> TotalOrdersWindow
deactivate Logic

TotalOrdersWindow --> MainWindow
deactivate TotalOrdersWindow

MainWindow --> MainWindow
deactivate MainWindow

[<--MainWindow
deactivate MainWindow
@enduml
Binary file added docs/images/SortOrdersCommandClassDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/SortOrdersCommandSequenceDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/SortOrdersModelSequenceDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/SortOrdersParserSequenceDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/TotalOrdersSequenceDiagram0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/TotalOrdersSequenceDiagram1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit c77588d

Please sign in to comment.