From 475cdce802fc9afd009ec2807b2db087237cb158 Mon Sep 17 00:00:00 2001 From: ziyi105 Date: Tue, 14 Nov 2023 09:12:30 +0800 Subject: [PATCH 1/3] Update DG parser sequence diagram --- docs/DeveloperGuide.md | 4 ++-- docs/diagrams/sequence/Parser.puml | 5 +++-- docs/images/sequence/Parser.svg | 1 + 3 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 docs/images/sequence/Parser.svg diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index 34fe1bb6e9..59e761977f 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -119,10 +119,10 @@ The `Parser` component is responsible for interpreting the user's input and retu Below is the sequence diagram of a parser which shows how `Parser` parses user input: -![Parser Parsing User Input Sequence Diagram](images/sequence/Parser_execute_command.svg) +![Parser Parsing User Input Sequence Diagram](images/sequence/Parser.svg)
*Figure 5: Parser Parsing User Input Sequence Diagram* -When user input a string to `Main`, it passes the full user input to `Parser` via `parseCommand`. In `parseCommand`, it finds the matching keyword for different command from the user input, it calls the respective `prepareCommand` method within itself. `prepareCommand` then generates the corresponding command class and return it to `parseCommand`, which returns the `Command` back to `Main` for execution. +When user input string is received through `Ui`, which passes the full user input to `Main`. `Main` then passes it to `Parser` via `parseCommand` for interpretation. In `parseCommand`, it finds the matching keyword for different command from the user input, it calls the respective `prepareCommand` method within itself. `prepareCommand` then generates the corresponding command class and return it to `parseCommand`, which returns the `Command` back to `Main` for execution. ### Storage component API: [Storage.java](https://github.com/AY2324S1-CS2113-T17-2/tp/blob/master/src/main/java/seedu/cafectrl/storage/Storage.java) diff --git a/docs/diagrams/sequence/Parser.puml b/docs/diagrams/sequence/Parser.puml index 665c0ce84b..be190e3554 100644 --- a/docs/diagrams/sequence/Parser.puml +++ b/docs/diagrams/sequence/Parser.puml @@ -1,12 +1,13 @@ @startuml 'https://plantuml.com/sequence-diagram -actor User +Participant ":Ui" as Ui Participant ":Main" as Main Participant ":Parser" as Parser Participant ":XYZCommand" as XYZCommand -User -> Main: fullUserInput: String +activate Ui +Ui -> Main: fullUserInput: String activate Main Main -> Parser: parseCommand(fullUserInput: String) activate Parser diff --git a/docs/images/sequence/Parser.svg b/docs/images/sequence/Parser.svg new file mode 100644 index 0000000000..ee63bab6b9 --- /dev/null +++ b/docs/images/sequence/Parser.svg @@ -0,0 +1 @@ +:Ui:Ui:Main:Main:Parser:Parser:XYZCommand:XYZCommandfullUserInput: StringparseCommand(fullUserInput: String)alt[XYZCOMMAND_WORD]prepareXYZCommand(requiredArguments)XYZCommand(requiredArguments)XYZCommandXYZCommandexecute() \ No newline at end of file From ade34a11a855d97cbf99b3ed42c956ee6c0ced9e Mon Sep 17 00:00:00 2001 From: ziyi105 Date: Tue, 14 Nov 2023 09:15:32 +0800 Subject: [PATCH 2/3] Change index to dish in UG --- docs/UserGuide.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/docs/UserGuide.md b/docs/UserGuide.md index da36f81399..4d781c82a7 100644 --- a/docs/UserGuide.md +++ b/docs/UserGuide.md @@ -107,7 +107,7 @@ list_menu ------------------------------------------------------------------------ To list out the ingredients needed along with the quantity for a specific dish: Parameters: index/DISH_INDEX -Example: list_ingredients index/1 +Example: list_ingredients dish/1 ------------------------------------------------------------------------ To buy ingredient: buy_ingredient ingredient/INGREDIENT1_NAME qty/INGREDIENT1_QTY[, ingredient/INGREDIENT2_NAME, qty/INGREDIENT2_QTY...] @@ -190,13 +190,13 @@ Okay! chicken rice is deleted! :) ### Editing price of a dish : `edit_price` Edits the price of an existing dish on the menu -Format: `edit_price index/DISH_INDEX price/NEW_PRICE` +Format: `edit_price dish/DISH_INDEX price/NEW_PRICE` * `NEW_PRICE` must be a positive number and can have up to 2 decimal places. * The index refers to the index number shown in the menu list * The index must be a positive integer -Example: `edit_price index/1 price/4.50` +Example: `edit_price dish/1 price/4.50` Output: ``` @@ -229,7 +229,7 @@ Lists out the ingredients needed along with the quantity for a specific dish Format: `list_ingredients dish/DISH_INDEX` Example: -- list followed by list_ingredients index/1 lists the ingredients of the 1st dish on the menu +- list followed by list_ingredients dish/1 lists the ingredients of the 1st dish on the menu ``` +-------------------------------------------------------+ @@ -448,7 +448,7 @@ Format: `bye` |---------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | **Add** | `add name/DISH_NAME price/PRICE ingredient/INGREDIENT1_NAME qty/INGREDIENT1_QTY [, ingredient/INGREDIENT2_NAME qty/INGREDIENT2_QTY, ...]`

Example:
`add name/chicken rice price/3.00 ingredient/rice qty/50g, ingredient/chicken qty/100g` | | **List Menu** | `list_menu` | -| **List Ingredients** | `list_ingredients index/DISH_INDEX`

Example:
`list_ingredients index/1` | +| **List Ingredients** | `list_ingredients dish/DISH_INDEX`

Example:
`list_ingredients index/1` | | **Delete** | `delete DISH_INDEX`

Example:
`delete 1` | | **Edit Price** | `edit_price dish/DISH_INDEX price/NEW_PRICE`

Example:
`edit_price dish/1 price/4.50` | | **List Sale** | `list_total_sales` | @@ -465,4 +465,5 @@ Format: `bye` ## Glossary - **Dish index**: Index of the dish according to `list_menu`. -- **Stock**: The quantity of ingredient available in the pantry of the cafe. \ No newline at end of file +- **Stock**: The quantity of ingredient available in the pantry of the cafe. +- **Qty**: Quantity \ No newline at end of file From ba5a02110c100f3a19bd30d748488845eaa13f72 Mon Sep 17 00:00:00 2001 From: ziyi105 Date: Tue, 14 Nov 2023 09:21:53 +0800 Subject: [PATCH 3/3] Update PPP with bugs found --- docs/team/ziyi105.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/team/ziyi105.md b/docs/team/ziyi105.md index 980aeff58a..22136ca32b 100644 --- a/docs/team/ziyi105.md +++ b/docs/team/ziyi105.md @@ -97,6 +97,8 @@ Café proprietors who prefer typing on CLI than any other interaction method and 5. Reminding team members to use github effectively (although some of my reminders were ignored :") - I encouraged my team members to report bugs using issue tracker on Github instead of using Telegram. (e.g., [#323](https://github.com/AY2324S1-CS2113-T17-2/tp/issues/323)) - I requested PR reviews from my team members as I noticed they haven't had a chance to do any review. (e.g., [PR #51](https://github.com/AY2324S1-CS2113-T17-2/tp/pull/51)) +6. Testing of features done my other team members + - [#382](https://github.com/AY2324S1-CS2113-T17-2/tp/issues/382), [#381](https://github.com/AY2324S1-CS2113-T17-2/tp/issues/381). [#372](https://github.com/AY2324S1-CS2113-T17-2/tp/issues/372), [#349](https://github.com/AY2324S1-CS2113-T17-2/tp/issues/349) ### Review/Mentoring Contributions 1. Reviewed and approved 52 PRs in total.