-
Notifications
You must be signed in to change notification settings - Fork 89
[CS2113-T17-2] CafeCTRL #14
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
Open
DextheChik3n
wants to merge
1,231
commits into
nus-cs2113-AY2324S1:master
Choose a base branch
from
AY2324S1-CS2113-T17-2:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 250 commits
Commits
Show all changes
1231 commits
Select commit
Hold shift + click to select a range
c2e5d0c
Merge pull request #321 from NaychiMin/error-handling-decoding-of-sal…
Cazh1 0dc39bb
Add logging to add dish related functions
DextheChik3n 1f53b9c
Merge branch 'master' into 301-negative-ingredient-qty-v2.1
DextheChik3n 32a18bb
Add methods to check the validity of pantryStock data format
ziyi105 1c9c475
Inlcude pattern and matcher in PPP
ziyi105 002138b
Merge pull request #331 from ziyi105/update-PPP
ziyi105 e60a02a
Add in sequence diagram for list_ingredients command.
NaychiMin 3ef9520
Add in sequence diagram for list_sale command.
NaychiMin df55bc8
Add in sequence diagram for isDishCooked() function in Pantry class.
NaychiMin ede4342
Add in sequence diagram for calculateMaxDish() function in Pantry class.
NaychiMin 9c80fc3
Improve coding standard.
NaychiMin 8d2f29e
Edit List_ingredient command in DG with updated sequence diagram.
NaychiMin b4acb84
Add in sequence diagram and necessary description into DG for
NaychiMin ad81169
Add in sequence diagram and description for isDishCooked() function from
NaychiMin c460bae
Add in sequence diagram and description for calculateMaxDish() function
NaychiMin 23d7f8b
Removed unused sequence diagram.
NaychiMin 5de6fc9
Add JUnit tests for FileManager class
DextheChik3n 6f7526d
Resolve checkstyle issues
DextheChik3n 11dc0cb
Remove unused test file
DextheChik3n 1a0025b
Merge pull request #330 from DextheChik3n/301-negative-ingredient-qty…
ziyi105 13f73b0
Update PPP
Cazh1 cba4af9
Update png used
Cazh1 6f934de
Modified message to match format
ShaniceTang 92a3073
Merge branch 'master' of https://github.com/AY2324S1-CS2113-T17-2/tp …
ShaniceTang 600ede0
Merge pull request #336 from Cazh1/Update-self-PPP
ShaniceTang b522977
Merge branch 'master' of https://github.com/AY2324S1-CS2113-T17-2/tp …
ShaniceTang a516273
Resize Images for PPP
Cazh1 0fda7d9
Merge pull request #337 from Cazh1/Update-self-PPP
Cazh1 59359ef
Resize of pictures for marking
Cazh1 363a89b
Merge pull request #338 from Cazh1/Update-self-PPP
Cazh1 6d5c64a
Update text size to comply with requirements
Cazh1 ed8fabf
Merge pull request #339 from Cazh1/Update-self-PPP
Cazh1 c4c0009
Update PPP to resize text
Cazh1 b42e44c
Merge pull request #340 from Cazh1/Update-self-PPP
Cazh1 ff06160
Edit formatting of PPP
DextheChik3n a122c3f
Update formatting of UG and DG
DextheChik3n 0a2996a
Edit hyperlinks for table of contents in UG
DextheChik3n fa189ae
Merge pull request #341 from DextheChik3n/edit-ppp
DextheChik3n 0b28754
Update table of contents in DG with changes made.
NaychiMin 68a532c
Update user guide with edited command tag for list_ingredients.
NaychiMin 90d7528
Improve code quality.
NaychiMin 00d977d
Edit PPP and renamed PPP folder to all small caps of github user name.
NaychiMin 03cc365
Merge branch 'master' into Update-DG-with-changes-made-v2.1
NaychiMin e76fc31
Add relevant examples in PPP.
NaychiMin 4aadb07
Format encoding of current dish price to 2dp.
NaychiMin 0962c62
Merge pull request #332 from DextheChik3n/196-junit-test-for-file-man…
NaychiMin 1860742
Merge branch 'master' into Update-DG-with-changes-made-v2.1
NaychiMin 68698da
Update UG
ziyi105 bfe545c
Update DG architecture sequence diagram and AboutUs photo
ShaniceTang 16dca45
Modify buy ingredient message to prevent formatting issues
ShaniceTang 257540b
Add JUnit test for methods in parser class
ShaniceTang 7536828
Add javadoc
ShaniceTang 7d79f50
Remove extra whitespace
ShaniceTang 3876bb9
Merge branch 'master' of https://github.com/AY2324S1-CS2113-T17-2/tp …
ShaniceTang b54b380
Update architecture sequence diagram
ShaniceTang 35115ad
Edit minor details in DG
ziyi105 41b693e
Add Future Enhancements in DG
ziyi105 2579e3e
Add future enhancement under DG contributions in PPP
ziyi105 62a6099
Update src/main/java/seedu/cafectrl/ui/Messages.java
ShaniceTang 8311bd9
PPP: add more info under team tasks and help feature
ziyi105 2ef94c7
Add more info under general formatting in PPP
ziyi105 8472c4b
Update error message for decoding pantry stock data
ziyi105 af9d862
Correct typo
ziyi105 ced653f
Add ViewTotalStockCommand and BuyIngredientCommand to DG
ShaniceTang f26744b
Merge branch '326-junit-dg-javadoc' of https://github.com/ShaniceTang…
ShaniceTang 8b103eb
Merge pull request #347 from ziyi105/323-standardise-error-messages-f…
ziyi105 459144d
Add Javadoc and author tag
ziyi105 c65114d
Merge branch 'master' of https://github.com/AY2324S1-CS2113-T17-2/tp …
ShaniceTang 22af8c0
Update PPP
ShaniceTang de520bb
Update Storage class diagram
DextheChik3n 8c3b0c6
Fix bug found in list_sales command.
NaychiMin 124baf2
Update coding standard in CafeCtrl.java
ziyi105 6396a80
Update coding standard in EditPriceCommand and HelpCommand
ziyi105 3cf0e86
Change comparison from .equals() to .equalsIgnoreCase()
NaychiMin f98139d
Update src/main/java/seedu/cafectrl/data/Menu.java
NaychiMin 419eb11
Update src/main/java/seedu/cafectrl/data/OrderList.java
NaychiMin d1abc91
Update coding standard up to Pantry.java
ziyi105 f6dad25
Update coding standard
ziyi105 e42c6d7
Update coding standard in Ui.java
ziyi105 28d2c33
Update according to checkStyle
ziyi105 66becd9
Merge pull request #348 from ziyi105/323-standardise-error-messages-f…
DextheChik3n 88182f0
Add a line after loading data
ziyi105 6556585
Update src/main/java/seedu/cafectrl/data/CurrentDate.java
ziyi105 b721daa
Assign variable to obj.name
ziyi105 e8e7e10
Remove {more to be added} in UG
ziyi105 5ed0008
Merge pull request #345 from ziyi105/update-UG
DextheChik3n 24a11c1
Edit sequence diagrams according to reviews made.
NaychiMin d9c82f2
Update AddDishCommand sequence diagram
DextheChik3n 296f71d
Merge branch 'master' into Update-DG-with-changes-made-v2.1
NaychiMin ce52191
Update variable names
ziyi105 57023da
Merge branch 'master' into general-coding-standard-check
ziyi105 237419d
Merge pull request #343 from NaychiMin/Update-DG-with-changes-made-v2.1
ziyi105 0e8a2c0
Remove unused import
ziyi105 ddbe823
Update Storage class in DG
DextheChik3n 3fa34de
Merge branch 'master' into general-coding-standard-check
ziyi105 0b64876
Remove unused class from functions in sales.
NaychiMin d54d01c
Update PPP
ziyi105 78093ff
Merge branch 'master' into handle-dishes-not-in-menu-v2.1
NaychiMin 3c0f2dd
Merge branch 'master' into 335-update-ug-dg-v2.1
DextheChik3n f300a74
Change order of variable in Pantry.java
ziyi105 4df42b0
Merge branch 'master' of https://github.com/AY2324S1-CS2113-T17-2/tp …
ShaniceTang 8d2a283
Refactor name of PPP to small caps.
NaychiMin da86bbe
Update Pantry.java
ziyi105 4f9540d
Edit PPP
NaychiMin e594262
Update Pantry.java
ziyi105 1357238
Handle tampering of menu.txt
ShaniceTang 273c063
Merge pull request #344 from ShaniceTang/326-junit-dg-javadoc
NaychiMin 2bbca99
Merge branch 'master' into handle-dishes-not-in-menu-v2.1
NaychiMin 4abbf3f
Merge pull request #351 from ziyi105/general-coding-standard-check
ziyi105 77e1c72
Merge branch 'general-coding-standard-check'
ziyi105 f0e1bdd
Update figure number and formatting
DextheChik3n 1212ef6
Add profile picture
DextheChik3n 4a20b29
Edit logic related to handling dishes not in menu.
NaychiMin 6a15c01
Merge branch 'master' into handle-dishes-not-in-menu-v2.1
NaychiMin 5c1113c
Add reviews on other teams' PR
ziyi105 b897297
Edit add dish command output message
DextheChik3n 327b44a
Update UG for add dish command
DextheChik3n b1096d9
Edit PPP.
NaychiMin bc62c5b
Merge branch 'master' into rename-ppp
NaychiMin 50902a6
Remove argument check for Help command
ziyi105 a9d282f
Format PPP
ShaniceTang 648e9fe
Merge pull request #352 from NaychiMin/rename-ppp
ShaniceTang bc6bac8
Merge branch 'master' of https://github.com/AY2324S1-CS2113-T17-2/tp …
ShaniceTang 9784662
Merge pull request #353 from ziyi105/master
ShaniceTang f05609b
Merge pull request #356 from ShaniceTang/355-mini-ppp
NaychiMin 96151da
Update UG
DextheChik3n 775f7cc
Merge branch 'master' into 335-update-ug-dg-v2.1
DextheChik3n 709c0bd
Merge pull request #354 from ziyi105/update-PPP-last
ShaniceTang 025dc44
Update src/main/java/seedu/cafectrl/data/OrderList.java
NaychiMin c468153
Update src/main/java/seedu/cafectrl/data/OrderList.java
NaychiMin 4a5bdf8
Changes made according to Review.
NaychiMin 14d5b0e
Merge branch 'master' into handle-dishes-not-in-menu-v2.1
NaychiMin 9b94d06
Merge pull request #350 from NaychiMin/handle-dishes-not-in-menu-v2.1
DextheChik3n 8c6a5c9
Merge branch 'master' into 335-update-ug-dg-v2.1
DextheChik3n 3b38993
Merge pull request #357 from DextheChik3n/335-update-ug-dg-v2.1
ShaniceTang 7ae759b
Edit profile picture size
DextheChik3n b7c08b6
Add colon to entity names
ShaniceTang 41b6693
Fix broken links
ShaniceTang 0fd634e
Handle no ingredient for dish in menu.txt
ShaniceTang 9ea67c5
Standardize loading error message
ShaniceTang bcd42b3
Merge pull request #361 from ShaniceTang/360-check-dg
NaychiMin 16697bd
Fix broken links
ShaniceTang bce2ee1
Improve code quality
ShaniceTang 18594eb
Merge pull request #362 from ShaniceTang/360-check-dg
NaychiMin 590597b
Fix line under TOC
ShaniceTang e4716bb
Merge branch 'master' of https://github.com/AY2324S1-CS2113-T17-2/tp …
ShaniceTang ec219d7
Fix line under TOC
ShaniceTang b3cde80
Merge pull request #363 from ShaniceTang/360-check-dg
DextheChik3n bb544ab
Merge pull request #359 from ziyi105/remove-argumen-check-for-help
DextheChik3n 1f60e2a
Change index to dish in UG
ziyi105 fbc355c
Remove line after TOC
ShaniceTang 5495765
Corrected casing for edit_price in UG
ziyi105 3fece68
Merge pull request #369 from ShaniceTang/360-check-dg
DextheChik3n a83defa
Merge pull request #364 from DextheChik3n/358-edit-profile-picture-v2.1
ShaniceTang aed269d
Update Code Quality of project
Cazh1 b0a0cbf
Update buy ingredient output in user guide
ShaniceTang 70bb27a
Convert names in menu.txt to lowercase
ShaniceTang 3cf1e03
Edit tag of list_ingredients command.
NaychiMin 46ba05d
Update DG accordingly for list_ingredients.
NaychiMin 927feec
Edit JUnit test for list_ingredients.
NaychiMin 6d2e8b2
Edit output message of add_order for better clarity.
NaychiMin 7795bac
Fix help command not showing
ziyi105 4a5519d
Add additional error handling to decode orders.txt.
NaychiMin 44d728c
Edit output of add_order for better clarity.
NaychiMin ad6fa2b
Update DG with updated sequence diagram.
NaychiMin ac8fddf
Edit list_total_sales and formatting of UG.
NaychiMin fac41f1
Merge pull request #383 from NaychiMin/370-change-parameter-of-list-i…
ShaniceTang 173bc37
Merge pull request #384 from NaychiMin/374-edit-output-message-add-or…
ShaniceTang d8bfe96
Merge pull request #385 from NaychiMin/380-decode-negative-dish-qty-v2.1
ShaniceTang b78cee5
Add photo in AboutUs
NaychiMin 2dcaa35
Fix bugs for delete, buyIngredient and viewTotalStock command
ShaniceTang 3a93909
Update UG and DG
Cazh1 80b464e
Merge branch 'master' into Update-Code-Quality-
Cazh1 d007813
Merge branch 'master' into minor-last-min-edit
ziyi105 2734620
Merge pull request #388 from NaychiMin/Edit-UG-v2.1
ziyi105 8d30658
Fix formatting error
Cazh1 d4031eb
Merge branch 'master' of https://github.com/AY2324S1-CS2113-T17-2/tp …
ShaniceTang ff72eb0
Merge branch 'master' of https://github.com/AY2324S1-CS2113-T17-2/tp …
ShaniceTang 16ff7a4
Merge pull request #389 from ziyi105/minor-last-min-edit
NaychiMin 7c4962d
Update code to comply with Gradle
Cazh1 3f5d746
Merge branch 'Update-Code-Quality-' of https://github.com/Cazh1/tp in…
Cazh1 177c979
Rename newPrice to newDishPrice in EditPriceCommand.java for better c…
ziyi105 ba4f595
Fix formatting error
Cazh1 e27a795
Remove the use of "this" reference
ziyi105 fbdfc4c
Improve code quality
ShaniceTang 9032698
Update JUnit test expected output
ShaniceTang 4992ae3
Merge branch 'master' of https://github.com/AY2324S1-CS2113-T17-2/tp …
ShaniceTang ad1f273
Merge pull request #390 from Cazh1/Update-Code-Quality-
ziyi105 f72cc6e
Add photo in aboutUs
ziyi105 561f74e
Update known issue regarding differentiating hash string and data text
ziyi105 5ebca21
Update known issues regarding the hyperlink of ToCs
ziyi105 ddd88c7
Replace parser class diagram with a better resolution one
ziyi105 12e639b
Merge pull request #392 from ziyi105/386-remove-this-references
DextheChik3n 45fd69c
DG: improve resolution of diagram image
ziyi105 ba27496
Edit add dish command's invalid price message
DextheChik3n 855d4ce
Merge branch 'master' into 373-edit-add-dish-messages-v2.1
DextheChik3n fd79c2b
Update regex and error message
ShaniceTang 69718b9
Merge branch 'master' of https://github.com/AY2324S1-CS2113-T17-2/tp …
ShaniceTang 393beca
Edit add dish command's invalid price message
DextheChik3n c5f18e0
Refactor magic strings in Storage class
DextheChik3n e0ac8d3
Merge pull request #391 from ShaniceTang/minor-fixes
DextheChik3n 956634e
Merge branch 'master' into 373-edit-add-dish-messages-v2.1
DextheChik3n 3a9d442
Edit ingredient qty regex for parseIngredient function
DextheChik3n 3d9d018
Change photo for AboutUs page
DextheChik3n e75d6a3
Remove the issue about hyperlink in UG
ziyi105 52ad74a
Resolve checkstyle issues
DextheChik3n 6db47af
UG: update Known Issues regarding adding order with unknown dish
ziyi105 bf4eedd
Refactor files in ui package
DextheChik3n 35f30a7
Refactor files in storage package
DextheChik3n d16bbb7
Refactor files in data package
DextheChik3n 61a1ef6
Add error handling of user input in add order command
DextheChik3n 25e7d39
Edit to ensure all dish and ingredient names are convert to lowercase
DextheChik3n 43a2ebd
Resolve JUnit test errors
DextheChik3n 1f1ff80
Resolve checkstyle errors
DextheChik3n eaed86f
Merge pull request #393 from ziyi105/379-add-known-issue-unable-to-di…
DextheChik3n 3cdc854
Edit hash string message
DextheChik3n 234c862
Merge pull request #394 from DextheChik3n/373-edit-add-dish-messages-…
Cazh1 2af72b1
Update formatting of user guide and PPP
NaychiMin 90e66d7
Merge branch 'master' into Edit-UG-v2.1
NaychiMin 7e02db4
Merge pull request #395 from NaychiMin/Edit-UG-v2.1
DextheChik3n 62f49ea
Add in hyperlink and edit list_ingredients command tag in PPP.
NaychiMin 2eabb48
Merge branch 'master' into Edit-UG-v2.1
NaychiMin 7f513db
Merge pull request #396 from NaychiMin/Edit-UG-v2.1
ShaniceTang 475cdce
Update DG parser sequence diagram
ziyi105 ade34a1
Change index to dish in UG
ziyi105 2859132
Update Zi Yi's photo
ziyi105 ba5a021
Update PPP with bugs found
ziyi105 6c8a74d
Merge pull request #397 from ziyi105/update-DG
ziyi105 891f03e
Update HelpCommand
ziyi105 289ee61
Update UG regarding last day string
ziyi105 5ea7df4
Merge pull request #398 from ziyi105/update-DG
Cazh1 5680041
Update PPP
ziyi105 1855718
Merge pull request #399 from ziyi105/update-DG
Cazh1 e338697
Edit PPP to reduce length.
NaychiMin 82fed56
Merge branch 'master' into Edit-UG-v2.1
NaychiMin fae600f
Add manual testing for edit price
ziyi105 36ad50e
Merge pull request #400 from NaychiMin/Edit-UG-v2.1
ziyi105 7f0ddcf
Adjust position of imagein PPP
ziyi105 9c6bbb5
Decrease length of PPP
ziyi105 2b02dd5
Merge branch 'master' into Add-manual-testing-guide-DG
ziyi105 e61fef9
Merge pull request #401 from ziyi105/Add-manual-testing-guide-DG
ziyi105 781b9e6
Edit PPP to reduce page length
ShaniceTang 0c7dfcc
Update ziyi105.md
ziyi105 69eabbc
Merge pull request #402 from ShaniceTang/smol-ppp
NaychiMin 826b3e3
reduce PPP length
ziyi105 56cd519
Merge branch 'Add-manual-testing-guide-DG'
ziyi105 01dd638
Merge pull request #403 from ziyi105/master
ziyi105 1923eba
Disable assertion
ziyi105 825ed91
Merge branch 'AY2324S1-CS2113-T17-2:master' into master
ziyi105 56507bd
Merge pull request #404 from ziyi105/master
NaychiMin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,4 @@ bin/ | |
|
||
/text-ui-test/ACTUAL.TXT | ||
text-ui-test/EXPECTED-UNIX.TXT | ||
META-INF/MANIFEST.MF |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
# About us | ||
|
||
Display | Name | Github Profile | Portfolio | ||
--------|:----:|:--------------:|:---------: | ||
 | John Doe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) | ||
 | Don Joe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) | ||
 | Ron John | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) | ||
 | John Roe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) | ||
 | Don Roe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) | ||
Display | Name | Github Profile | Portfolio | ||
--------|:--------:|:----------------------------------------:|:---------: | ||
 | Shanice | [Github](https://github.com/ShaniceTang) | [Portfolio](docs/team/johndoe.md) | ||
 | Naychi | [Github](https://github.com/NaychiMin/tp) | [Portfolio](docs/team/johndoe.md) | ||
 | Zi Yi | [Github](https://github.com/ziyi105) | [Portfolio](docs/team/johndoe.md) | ||
 | Dexter Hoon | [Github](https://github.com/DextheChik3n) | [Portfolio](docs/team/johndoe.md) | ||
 | Chua Zhong Heng | [Github](https://github.com/Cazh1/tp) | [Portfolio](docs/team/johndoe.md) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,8 +6,102 @@ | |
|
||
## Design & implementation | ||
|
||
{Describe the design and implementation of the product. Use UML diagrams and short code snippets where applicable.} | ||
## Design | ||
|
||
### Parser | ||
|
||
 | ||
|
||
*Figure 1: Parser Parsing User Input Sequence Diagram* | ||
|
||
API: [Parser.java]({repoURL}src/main/java/seedu/cafectrl/parser/Parser.java) | ||
|
||
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, then it calls the respective `prepareCommand` method within `Parser`. `prepareCommand` then generates the corresponding command class and return it to `parseCommand`, which returns the `Command` back to `Main` for execution. | ||
|
||
## Features | ||
|
||
### Add Dish | ||
|
||
 | ||
*Figure X: Execution of add_dish command* | ||
|
||
API: [AddDishCommand.java](https://github.com/AY2324S1-CS2113-T17-2/tp/blob/master/src/main/java/seedu/cafectrl/command/AddDishCommand.java) | ||
|
||
The `add_dish` command, add a dish to the `Menu` object and prints out a formatted message to state the name, price and ingredients entered for the dish. | ||
|
||
when the `execute()` method from `AddDishCommand` is called in the main class `CafeCtrl`, the `addDish()` method is first called to add the `Dish` object to the `Menu`. It will then call the `printAddDishMessage()` method, which gets all the parameters of the `Dish` object (dishName, dishPrice, dishIngredients) and passes them to the `Ui` to then be printed out to the User. | ||
|
||
Separation of Concerns was applied to ensure the `Ui` is only responsible with only displaying messages while the `Menu` deals with the logic of adding dish to the menu. This implementation also encapsulates the details of adding a dish and displaying messages. For example, The `AddDishCommand` class doesn't need to know how the internal details of the dish adding and message printing are performed. | ||
|
||
### Adding a Dish | ||
|
||
### List Menu | ||
A list command can be used to display all the `Dish` objects stored in `Menu`. | ||
|
||
The following class diagram illustrates the relationship between the respective classes involved in the creation and execution of a list command. | ||
 | ||
|
||
 | ||
|
||
Figure 1: Execution of list_menu command | ||
|
||
|
||
API: [ListMenuCommand.java]({repoURL}src/main/java/seedu/cafectrl/command/ListMenuCommand.java) | ||
|
||
When the `execute()` method of ListMenuCommand is invoked in Main, it checks if the size of the menu by running `menu.getSize()`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's nice to check whether the list is empty or not before the execution. |
||
|
||
1) If the menu is empty, it will call its `printEmptyMenu()` method to display to the user a `MENU_EMPTY_MESSAGE` in the Ui object and returns afterward. | ||
2) If the menu is not empty, it will call its `printFullMenu()` method. | ||
`printFullMenu()` will first print the top portion of the menu using the Ui object. | ||
It then iterates through the `Dish` objects in `Menu` in a "for" loop, using `menu.getDishFromId()` to retrieve the Dish object. | ||
The `dishName` and `dishPrice` are both access from `Dish` Class using `getName()` and `getPrice()` respectively. | ||
The data are then packaged nicely in a `leftAlignFormat`, with (indexNum + ". " + dishName," $" + dishPrice) such that | ||
e.g. (1. Chicken Rice $2.50) is shown. | ||
|
||
### List Ingredients | ||
 | ||
|
||
*Figure 2: Execution of list_ingredient command* | ||
|
||
API: [ListIngredientCommand.java]({repoURL}src/main/java/seedu/cafectrl/command/ListIngredientCommand.java) | ||
|
||
| No | Step | Description | | ||
|----|-------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ||
| 1 | Initialization | The sequence begins with the `Main` class invoking the `execute` method of the `ListIngredientCommand` after parsing a user command. | | ||
| 2-3 | Interaction with 'Menu' | The `ListIngredientCommand` communicates with the `Menu` class, invoking the `getMenuItemsList()` method to retrieve a list of menu items. The function returns an ArrayList of objects of 'Dish' type. | | ||
| 4 | Interaction with 'Ui' | The `ListIngredientCommand` communicates with the `Ui` class, invoking the `printIngredients()` method to print out the list of ingredients used for the selected dish. <br/> * The function returns an ArrayList of objects of 'Dish' type. The `get()` method is then invoked to get the dish of the specified index. However, this is ommitted to prevent unnecessary sophistication. | | ||
| 5-6 | Interaction with 'Dish' | The `Ui` class communicates with the `Dish` class, invoking the `getIngredients()` method to obtain the list of ingredients for the selected dish. The `Dish` class responds with an ArrayList of objects of 'Ingredient' type to the `Ui` class. | | ||
| 7-8 | Iteration through Ingredients | There is a loop that iterates through each ingredient in the list. The `Ui` class interacts with the `Ingredients` class, converting each ingredient to a string containing the ingredient and quantity needed. | | ||
| 9-10 | Display to User | The `Ui` class showcases the information to the user through the `showToUser()` method. | | ||
|
||
### Delete Dish | ||
|
||
### Delete Dish | ||
|
||
 | ||
<br>*Figure X: Execution of delete dish command | ||
|
||
API: [DeleteDishCommand.java]({repoURL}src/main/java/seedu/cafectrl/command/DeleteDishCommand.java) | ||
|
||
When the `execute()` method of `DeleteDishCommand` is invoked in `Main`, it subsequently calls `getMenuItemsList().get(dishIndexToBeDeleted)` method on the `Menu` object to retrieve the `Dish` object to be deleted. | ||
Following this, the `showDeleteMesage()` method in the Ui component is triggered to display a message to show the user which dish is about to be deleted. | ||
Afterward, `DeleteDishCommand` calls `removeDish(dishIndexToBeDeleted)` of the `Menu` object to remove the selected dish at the index indicated by the user. | ||
This sequence of actions orchestrates the flow of information and operations between `Main`, `DeleteDishCommand`, `Menu`, and `Ui` components, ensuring the seamless handling of the dish deleting functionality within the application. | ||
|
||
|
||
`DeleteDishCommand` is implemented in such a way because: | ||
1. It promotes loose coupling between components. For instance, `Main` doesn't need to know the details of how the `execute()` of `DeleteDishCommand` is executed or how the message is displayed in `Ui`. | ||
2. Each component has a specific role and responsibility. `Main` is responsible for receiving user input and invoking `execute()`, `DeleteDishCommand` is responsible for encapsulating the delete operation, `Menu` is responsible for managing the menu items, and `Ui` is responsible for displaying messages to the user. This separation of concerns makes the code more maintainable and easier to understand. | ||
|
||
|
||
### Edit Price | ||
|
||
 | ||
|
||
*Figure 3: Execution of edit_price command* | ||
|
||
API: [EditPriceCommand.java]({repoURL}src/main/java/seedu/cafectrl/command/EditPriceCommand.java) | ||
|
||
When the `execute()` method of `EditPriceCommand` is invoked in `Main`, it subsequently calls the `setPrice()` method on the `Dish` object to modify the price of the specific dish. Following this, the `showEditPriceMessages()` method in the Ui component is triggered to display a message related to the successful execution of the price modification process. This sequence of actions orchestrates the flow of information and operations between the `Main`, `EditPriceCommand`, `Dish`, and `Ui` components, ensuring the seamless handling of the price editing functionality within the application. | ||
|
||
## Product scope | ||
### Target user profile | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
theme: minima |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
@startuml | ||
'https://plantuml.com/sequence-diagram | ||
autonumber | ||
|
||
-> AddDishCommand: execute() | ||
activate AddDishCommand | ||
AddDishCommand -> Menu: addDish(dish: Dish) | ||
activate Menu | ||
return | ||
AddDishCommand -> Ui: printAddDishMessage(dish: Dish) | ||
|
||
|
||
activate Ui | ||
Ui -> Dish: getName() | ||
activate Dish | ||
Dish --> Ui: dishNameString: String | ||
deactivate Dish | ||
Ui -> Dish: getPrice() | ||
activate Dish | ||
Dish --> Ui: dishPrice: float | ||
deactivate Dish | ||
|
||
loop ingredients | ||
Ui -> Ingredients: toString() | ||
activate Ingredients | ||
Ingredients --> Ui | ||
deactivate Ingredients | ||
end loop | ||
|
||
Ui -> Ui: showToUser(message: String) | ||
activate Ui | ||
return | ||
return | ||
return | ||
|
||
@enduml |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
@startuml | ||
!define COMMAND class ListIngredientCommand | ||
!define UI class Ui | ||
!define MENU class Menu | ||
|
||
autonumber | ||
|
||
-> DeleteDishCommand : execute() | ||
activate DeleteDishCommand | ||
|
||
DeleteDishCommand -> Menu : getMenuItemsList().get(dishIndexToBeDeleted: int) | ||
activate Menu | ||
return (selectedDish: Dish) | ||
DeleteDishCommand -> Ui : showDeleteMessage(selectedDish: Dish) | ||
activate Ui | ||
Ui -> Ui : showToUser(message: String) | ||
activate Ui | ||
return | ||
return | ||
DeleteDishCommand -> Menu : removeDish(dishIndexToBeDeleted: int) | ||
activate Menu | ||
return | ||
return | ||
|
||
|
||
@enduml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
@startuml | ||
'https://plantuml.com/sequence-diagram | ||
|
||
autonumber | ||
|
||
Main -> EditPriceCommand: execute() | ||
activate EditPriceCommand | ||
EditPriceCommand -> Dish: setPrice(price: float) | ||
activate Dish | ||
EditPriceCommand -> Ui: showEditPriceMessages() | ||
deactivate EditPriceCommand | ||
deactivate Dish | ||
@enduml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
@startuml | ||
!define COMMAND class ListIngredientCommand | ||
!define UI class Ui | ||
!define MENU class Menu | ||
!define DISH class Dish | ||
!define PARSER class Parser | ||
|
||
autonumber | ||
-> ListIngredientCommand: execute() | ||
|
||
activate ListIngredientCommand | ||
ListIngredientCommand -> Menu : getMenuItemsList() | ||
activate Menu | ||
Menu --> ListIngredientCommand: selectedDish : Dish | ||
deactivate Menu | ||
|
||
ListIngredientCommand -> Ui : printIngredients(selectedDish: Dish) | ||
activate Ui | ||
Ui -> Dish : selectedDish.getIngredients() | ||
activate Dish | ||
Dish --> Ui : ingredients: Ingredient | ||
deactivate Dish | ||
|
||
|
||
loop ingredients | ||
Ui -> Ingredients: ingredient.toString() | ||
activate Ingredients | ||
Ingredients --> Ui | ||
deactivate Ingredients | ||
end loop | ||
|
||
Ui -> Ui: showToUser(message: String) | ||
activate Ui | ||
Ui --> Ui | ||
deactivate Ui | ||
Ui --> ListIngredientCommand | ||
deactivate Ui | ||
deactivate ListIngredientCommand | ||
<-- ListIngredientCommand | ||
|
||
@enduml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
@startuml | ||
'https://plantuml.com/class-diagram | ||
|
||
|
||
title Class Diagram of CafeCtrl `list_menu` Command | ||
|
||
CafeCtrl "1" --> "1" UI | ||
CafeCtrl "1" --> "1" Parser | ||
CafeCtrl "1" --> "1" Menu | ||
|
||
CafeCtrl "1" o-- "*" Command | ||
Command <|- ListMenuCommand | ||
Parser "1" --> "*" ListMenuCommand | ||
ListMenuCommand --> Menu | ||
Menu --> "*" Dish | ||
|
||
class CafeCtrl { | ||
- setup() | ||
- run() | ||
+ main(args : String[]) | ||
} | ||
|
||
class Command { | ||
|
||
} | ||
|
||
class UI { | ||
{static} - scanner : Scanner | ||
+ receiveUserInput() : String | ||
+ showMenuTop() : void | ||
+ showMenuBottom() : void | ||
+ showEmptyMenu() : void | ||
+ showMenuDish(indexNum : String, dishName : String, dishPrice : String) : void | ||
} | ||
|
||
class ListMenuCommand { | ||
# menu : Menu | ||
# ui : Ui | ||
+ execute() : void | ||
+ printEmptyMenu(ui : Ui) : void | ||
+ printFullMenu(menu : Menu, ui : Ui) | ||
} | ||
|
||
class Parser { | ||
{static} + parseCommand(menu : Menu, userInput : String, ui : Ui, pantry : Pantry, orderList : OrderList) : Command | ||
{static} - prepareListMenu(menu : Menu, ui : Ui) : Command | ||
} | ||
|
||
class Menu { | ||
- menuItems : ArrayList<Dish> | ||
+ getDishFromId(menuID : int) : Dish | ||
} | ||
|
||
class Dish { | ||
- name : String | ||
- price : float | ||
+ getName() : String | ||
+ getPrice() : float | ||
} | ||
@enduml |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding the number for each step is not necessary