Skip to content

Commit

Permalink
Merge pull request #397 from ziyi105/update-DG
Browse files Browse the repository at this point in the history
Update DG, UG and PPP
  • Loading branch information
ziyi105 authored Nov 14, 2023
2 parents 2859132 + ba5a021 commit 6c8a74d
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 10 deletions.
4 changes: 2 additions & 2 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
<br>*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)
Expand Down
13 changes: 7 additions & 6 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -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...]
Expand Down Expand Up @@ -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:
```
Expand Down Expand Up @@ -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

```
+-------------------------------------------------------+
Expand Down Expand Up @@ -448,7 +448,7 @@ Format: `bye`
|---------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **Add** | `add name/DISH_NAME price/PRICE ingredient/INGREDIENT1_NAME qty/INGREDIENT1_QTY<g/ml> [, ingredient/INGREDIENT2_NAME qty/INGREDIENT2_QTY<g/ml>, ...]`<br><br/>Example:<br/>`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`<br><br/>Example:<br>`list_ingredients index/1` |
| **List Ingredients** | `list_ingredients dish/DISH_INDEX`<br><br/>Example:<br>`list_ingredients index/1` |
| **Delete** | `delete DISH_INDEX`<br><br/>Example:<br>`delete 1` |
| **Edit Price** | `edit_price dish/DISH_INDEX price/NEW_PRICE`<br><br/>Example:<br>`edit_price dish/1 price/4.50` |
| **List Sale** | `list_total_sales` |
Expand All @@ -465,4 +465,5 @@ Format: `bye`
<!---@@author ziyi105--->
## Glossary
- **Dish index**: Index of the dish according to `list_menu`.
- **Stock**: The quantity of ingredient available in the pantry of the cafe.
- **Stock**: The quantity of ingredient available in the pantry of the cafe.
- **Qty**: Quantity
5 changes: 3 additions & 2 deletions docs/diagrams/sequence/Parser.puml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions docs/images/sequence/Parser.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions docs/team/ziyi105.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 6c8a74d

Please sign in to comment.