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

Branch update documentation #228

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
12 changes: 12 additions & 0 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,18 @@ The following activity diagram summarizes what happens when a user executes a ne

_{more aspects and alternatives to be added}_

### Adding order feature

### Implementation

Adds an `Order` to to a `Person` based on the person's `Phone` number. Example: `order p/8899 7788`
The process of adding an order is illustrated by the following diagrams.

![OrderSequenceDiagram-Logic](images/OrderSequenceDiagram.png)

After parsing the `order` command, the `LogicManager` will call the `Model#findPersonByPhoneNumber(number)` which returns the `Person` instance with matching number.
The `AddOrderCommand` will then call its own `addOrder(order, maybeEditablePeson)` which will add an order to the corresponding person, provided a person with matching number exists.

### Removing order feature

#### Implementation
Expand Down
19 changes: 11 additions & 8 deletions docs/diagrams/OrderSequenceDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ end box

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

[-> LogicManager : execute("order p/87438807")
Expand All @@ -34,14 +35,11 @@ create AddOrderCommand
AddOrderCommandParser -> AddOrderCommand
activate AddOrderCommand

AddOrderCommand --> AddOrderCommandParser :
AddOrderCommand --> AddOrderCommandParser : new(order)
deactivate AddOrderCommand

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

AddressBookParser --> LogicManager : a
deactivate AddressBookParser
Expand All @@ -51,24 +49,29 @@ activate AddOrderCommand

AddOrderCommand -> Model : findPersonByPhoneNumber("87438807")
activate Model
Model --> AddOrderCommand : person

Model --> AddOrderCommand : maybeEditablePerson
deactivate Model

AddOrderCommand -> Model : addOrder(order, person)
AddOrderCommand -> Model : addOrder(order, maybeEditablePerson.get())
activate Model
Model -> Person : addOrder(order)
activate Person
Person --> Model
deactivate Person
Model --> AddOrderCommand
deactivate Model

create CommandResult
AddOrderCommand -> CommandResult
activate CommandResult

CommandResult --> AddOrderCommand
CommandResult --> AddOrderCommand : generateSuccessMessage(maybeEditablePerson.get())
deactivate CommandResult

AddOrderCommand --> LogicManager : r
deactivate AddOrderCommand

[<--LogicManager
deactivate LogicManager
@endumlml
@enduml
Binary file modified docs/images/OrderSequenceDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading