diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index 44728a7eb7..6908c95fef 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -187,6 +187,11 @@ After parsing the `cancel` command, the `LogicManager` will call the `Model#dele The `Predicate` will then be used to filter the list using `stream()`. The updated `FilteredOrderList` will then be reflected in the GUI. +#### Known Limitations +1. As `StringUtil#containsWordIgnoreCase` searches by entire word, searching for `945` in `94567122` for `Phone` will result in false. This is also consistent in `Email`. + +2. Only one `PREFIX` can be chosen to filter by. Future improvements may include searching from more than one `PREFIX`. Example: `find o/19 n/John a/Lorong`. + ### Add a product to menu feature #### Implementation @@ -213,7 +218,7 @@ The `DeleteMenuCommand` class which extends the `Command` abstract class will be ![DeleteMenuCommandModelDiagram](images/DeleteMenuSequenceDiagram-Model.png) -After parsing the `menu` command, the `LogicManager` will call the `Model#deleteProduct(id)` which calls `AddressBook#deleteProduct(id)`. The `deleteProduct` of `ProductMenu` will then be called, which deletes a product from the `ArrayList LogicManager : execute("edit m/1 pn/Pie") +activate LogicManager + +LogicManager -> AddressBookParser : parseCommand("edit m/1 pn/Pie") +activate AddressBookParser + +create EditCommandParser +AddressBookParser -> EditCommandParser +activate EditCommandParser + +EditCommandParser --> AddressBookParser +deactivate EditCommandParser + +AddressBookParser -> EditCommandParser : parse("m/1 pn/Pie") +activate EditCommandParser + +create EditMenuCommandParser +EditCommandParser -> EditMenuCommandParser +activate EditMenuCommandParser + +EditMenuCommandParser --> EditCommandParser +deactivate EditMenuCommandParser + +EditCommandParser -> EditMenuCommandParser : parse("m/1 pn/Pie") +activate EditMenuCommandParser + +create EditMenuCommand +EditMenuCommandParser -> EditMenuCommand +activate EditMenuCommand + +EditMenuCommand --> EditMenuCommandParser : +deactivate EditMenuCommand + +EditMenuCommandParser --> EditCommandParser : e +deactivate EditMenuCommandParser +'Hidden arrow to position the destroy marker below the end of the activation bar. +EditMenuCommandParser -[hidden]-> EditCommandParser +destroy EditMenuCommandParser + +EditCommandParser --> AddressBookParser : e +deactivate EditCommandParser +'Hidden arrow to position the destroy marker below the end of the activation bar. +EditCommandParser -[hidden]-> AddressBookParser +destroy EditCommandParser + +AddressBookParser --> LogicManager : e +deactivate AddressBookParser + +LogicManager -> EditMenuCommand : execute(m) +activate EditMenuCommand + +EditMenuCommand -> Model : editProduct(target, editedProduct) +activate Model + +Model --> EditMenuCommand +deactivate Model + +create CommandResult +EditMenuCommand -> CommandResult +activate CommandResult + +CommandResult --> EditMenuCommand +deactivate CommandResult + +EditMenuCommand --> LogicManager : r +deactivate EditMenuCommand + +[<--LogicManager +deactivate LogicManager +@enduml diff --git a/docs/diagrams/EditMenuSequenceDiagram-Model.puml b/docs/diagrams/EditMenuSequenceDiagram-Model.puml new file mode 100644 index 0000000000..af2ef28055 --- /dev/null +++ b/docs/diagrams/EditMenuSequenceDiagram-Model.puml @@ -0,0 +1,33 @@ +@startuml +!include style.puml +skinparam ArrowFontStyle plain + +box Model MODEL_COLOR_T1 +participant ":Model" as Model MODEL_COLOR +participant ":AddressBook" as AddressBook MODEL_COLOR +end box + +box ProductMenu +participant ":ProductMenu" as ProductMenu +end box + +[-> Model : editProduct(target, editedProduct) +activate Model + +Model -> AddressBook : editProduct(target, editedProduct) +activate AddressBook + +AddressBook -> ProductMenu : editProduct(target, editedProduct) +activate ProductMenu + +ProductMenu -> ProductMenu : editProduct(target, editedProduct) +ProductMenu -> AddressBook +deactivate ProductMenu + +AddressBook --> Model : +deactivate AddressBook + +[<-- Model +deactivate Model + +@enduml diff --git a/docs/images/EditMenuSequenceDiagram-Logic.png b/docs/images/EditMenuSequenceDiagram-Logic.png new file mode 100644 index 0000000000..0ee90b7b88 Binary files /dev/null and b/docs/images/EditMenuSequenceDiagram-Logic.png differ diff --git a/docs/images/EditMenuSequenceDiagram-Model.png b/docs/images/EditMenuSequenceDiagram-Model.png new file mode 100644 index 0000000000..4687c1c45d Binary files /dev/null and b/docs/images/EditMenuSequenceDiagram-Model.png differ