Skip to content

Commit

Permalink
Merge pull request #198 from bava98/Documentation
Browse files Browse the repository at this point in the history
Update User Guide and Developer Guide
  • Loading branch information
whyjayxp committed Apr 15, 2019
2 parents 706d93a + 6c572ce commit aa37ca5
Show file tree
Hide file tree
Showing 7 changed files with 389 additions and 51 deletions.
223 changes: 195 additions & 28 deletions docs/DeveloperGuide.adoc

Large diffs are not rendered by default.

149 changes: 126 additions & 23 deletions docs/UserGuide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ Some of the parameters have restrictions and they are stated below.
* `NUMBER_OF_SEATS` and `NUMBER_OF_CUSTOMERS` have to be
* `ITEM_CODE` has to be in the form of an uppercase alphabet followed by a double digit integer.
* `QUANTITY` has to be a whole number between 0 and 2,000,000 inclusive.
* `ITEM_NAME` has to be
* `ITEM_PRICE` has to be
* `ITEM_NAME` has to be in alphanumeric format and may contain spaces, but should not be blank.
* `ITEM_PRICE` has to be a nonnegative rational number with 2 decimal digits.
* `YEAR` has to be a 4 digit whole number within 2000 and the current year.
* `MONTH` has to be a whole number within 1 to 12.
* `DAY` has to be a whole number within 1 to 31 provided it exists in the desired month and year.
Expand Down Expand Up @@ -662,55 +662,151 @@ image::Bill_UpdatedSeats.png[]
// tag::menumode[]
=== Menu Mode

In Menu Mode, you can perform menu-related operations. The application will display the current items on the menu.
In Menu Mode, you can track all updates to the menu, and the application will display the current items on the menu.

image::MMUi.png[width="790"]
This mode only uses the side panel, to avoid any confusion and for ease of use. The function is as follows:

* *Menu Panel*: This panel displays the currently available items on the menu along with their item codes and price.

Here are the commands that you can use in this mode to efficiently handle the menu in your restaurant.

[[AddToMenu]]
==== Adding menu items to the menu : `addToMenu`

Adds the specified item to the menu. +
Format: `addToMenu ITEM_CODE ITEM_NAME ITEM_PRICE`
If your restaurant has a new dish you would like to make available for your customers, this command allows you to add that item to the menu by specifying the item code, name and price. +

****
* Item code, name and price must be valid (follow the format specified).
*Format*: `addToMenu c/ITEM_CODE n/ITEM_NAME p/ITEM_PRICE` +
*Shortcut*: `add`
****

Examples:
[TIP]
Order of the input parameters does not matter (i.e. any permutation of `c/ITEM_CODE n/ITEM_NAME p/ITEM_PRICE` can be
keyed in and the command will work as intended).

* `addToMenu c/A02 n/French Fries p/2.00` +
Adds French Fries with item code A02 and price $2.00 to the menu.
[IMPORTANT]
RestOrRant does not allow you to add two items with the same item code, they are considered to be the same item. Make sure to have different item codes for all your available dishes!

[width="100%",cols="5%,95%", grid=none]
|===
ifdef::env-github[| :white_check_mark: a|]
ifndef::env-github[a| icon:check[role="green", size="2x"] a|]
You will see a success message in the Results Display and the updated menu with the new item will be displayed in the Menu Panel.

a| a| For example, the menu initially has 15 items as shown below.

image::AddToMenu_Before.png[]

Suppose you would like to add a Chocolate Ice Cream to the menu. After executing `addToMenu c/W16 n/Chocolate Ice Cream p/1.50`, you will see a success message in the Results Display, as shown below.

image::AddToMenu_RD.png[]
The Menu Panel will also be updated and you will now see 16 items displayed. As seen in the image below, a new 16th item with code W16, name Chocolate Ice Cream and price of 1.50 has been added to the menu.

image::AddToMenu_After.png[]
|===

[[DeleteFromMenu]]
==== Deleting menu items from the menu : `deleteFromMenu`

Deletes the item specified by the item code from the menu. +
Format: `deleteFromMenu ITEM_CODE`
Suppose you now decide you no longer want to sell a particular dish, and would like to make it unavailable for customers. You can do so by specifying the item code of the item you wish to remove. +

****
* Item has to exist in the menu (item code must be valid).
* The restaurant must be empty (there should be no customers).
*Format*: `deleteFromMenu ITEM_CODE` +
*Shortcut*: `del`
****

Examples:
[NOTE]
You can only delete item codes that already exist in the menu. You can add items to the menu using the <<AddToMenu,
`addToMenu`>> command. +
The restaurant must be empty (there should not be any occupied tables).

[IMPORTANT]
Deleting an item from the menu would also erase the quantity ordered associated with that item, and this item will not show up on the Menu Panels in all modes. If you choose to add the same item to the menu again, it would be considered as a new item with quantity ordered starting from zero.

* `deleteFromMenu A02` +
Deletes the menu item with item code A02 from the menu.
[width="100%",cols="5%,95%", grid=none]
|===
ifdef::env-github[| :white_check_mark: a|]
ifndef::env-github[a| icon:check[role="green", size="2x"] a|]
You will see a success message in the Results Display and the displayed menu on the Menu Panel would have the specified item removed.

a| a| For example, the menu initially has 6 items as shown below.

image::AddToMenu_After.png[]

Suppose you would like to delete the Beef Burger from the menu. After executing `deleteFromMenu W04`, you will see a success message in the Results Display, as shown below.

image::DeleteFromMenu_RD.png[]
The Menu Panel will also be updated and you will now see 5 items displayed. As seen in the image below, Beef Burger
has been deleted from the menu.

image::DeleteFromMenu_After.png[]
|===

[[ClearMenu]]
==== Clearing all the items in the menu : `clearMenu` _(Coming in v1.4)_
==== Clearing all the items in the menu : `clearMenu`

Removes all menu items from the menu. +
Format: `clearMenu`
This command allows you to clear all the items from the menu, if you ever need to start afresh. +

****
* The menu must be non-empty (there should already be items in the menu).
* The restaurant must be empty (there should be no customers).
*Format*: `clearMenu` +
*Shortcut*: `clear`
****

Examples:
[NOTE]
The menu must not be empty (one or more items should exist in the menu). +
The restaurant must be empty (there should not be any occupied tables).

[IMPORTANT]
This command is irreversible and will not save the menu under restaurant statistics.

[width="100%",cols="5%,95%", grid=none]
|===
ifdef::env-github[| :white_check_mark: a|]
ifndef::env-github[a| icon:check[role="green", size="2x"] a|]
You will see a success message in the Results Display and the Menu Panel will be empty.

a| a| For example, the menu initially has 6 items as shown below.

* `clearMenu`
image::AddToMenu_After.png[]

After executing `clearMenu`, you will see a success message in the Results Display, as shown below.

image::ClearMenu_RD.png[]
The Menu Panel will now be empty, as seen in the image below.

image::ClearMenu_After.png[]
|===

[[ToggleAvailability]]
==== Changing an item's availability : `toggleAvailability` _(Coming in v2.0)_

This command allows you to change an item's availability by specifying the item code. +

[TIP]
All added menu items are available by default.

[NOTE]
Calling this command on an available item would mark the item as unavailable, whereas calling this command on an unavailable item would mark it as available again.

****
*Format*: `toggleAvailability ITEM_CODE` +
*Shortcut*: `t`
****

[NOTE]
The specified item should exist in the menu.

[width="100%",cols="5%,95%", grid=none]
|===
ifdef::env-github[| :white_check_mark: a|]
ifndef::env-github[a| icon:check[role="green", size="2x"] a|]
You will see a success message in the Results Display and the background of the menu item would turn dark.

a| a| For example, say Lobster Burger has just become sold out. +
Executing `toggleAvailability W06` would make Lobster Burger unavailable for ordering and the background of the Lobster Burger would turn dark. +
Now, if the ingredients for Lobster Burger is available again, executing `toggleAvailability W06` would change the background to its original colour and enable Lobster Burger to be ordered by diners.
|===
// end::menumode[]

// tag::statisticsmode[]
Expand Down Expand Up @@ -958,6 +1054,13 @@ a|<<AddToMenu, `addToMenu`>> a| `*add*` a| `addToMenu c/ITEM_CODE n/ITEM_NAME p/
Adds A02 to the menu
a|<<DeleteFromMenu, `deleteFromMenu`>> a| `*del*` a| `deleteFromMenu ITEM_CODE` a| `deleteFromMenu A02` +
Removes A02 from the menu
a|<<ClearMenu, `clearMenu`>> a| `*clear*` a| `clearMenu` a| Clears all items from the menu
a|<<ToggleAvailability, `toggleAvailability`>> +
_(Coming in v2.0)_
a| t a|`toggleAvailability ITEM_CODE` a| `toggleAvailability W06` +

* Makes W06 unavailable for ordering if initially available
* Makes W06 available for ordering if initially unavailable
|=======================================================================

=== Statistics Mode
Expand Down
Binary file modified docs/diagrams/ModelComponentClassDiagram.pptx
Binary file not shown.
Binary file modified docs/diagrams/StorageComponentClassDiagram.pptx
Binary file not shown.
Binary file modified docs/images/StorageClassDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
60 changes: 60 additions & 0 deletions docs/team/sivakumarbavadharini.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
= Sivakumar Bavadharini - Project Portfolio for RestOrRant
:site-section: AboutUs
:imagesDir: ../images
:stylesDir: ../stylesheets

== PROJECT: RestOrRant

---

== About the project

My team and I were given a basic command line interface addressbook program and were tasked to enhance or morph it for our Software Engineering module project. We decided to morph it into a restaurant management system called _RestOrRant_. With _RestOrRant_, the restaurant's front-end operations can be streamlined via automation to maximise efficiency for waiters and cashiers. _RestOrRant_ allows restaurant managers to manage tables (availabilities and lists of orders), orders (whether they have been served and calculation of the bill), menu (updates to the menu) and statistics (daily, monthly and yearly revenue).

My role was to implement the menu feature end-to-end (across `UI`, `Model`, `Logic` and `Storage` components). The following sections elaborate on my enhancements as well as the relevant updates to the User Guide and Developer Guide to reflect these enhancements.

== Summary of contributions

This section contains a summary of my contributions to the code, documentation, and other minor enhancements made to _RestOrRant_.

* *Major enhancement*: I added the ability to add menu items to and delete menu items from the menu.
** What it does:
*** `addToMenu`: The `addToMenu` command allows the user to add a menu item to the menu. The menu item must be specified with an item code, name and price using labels such as `*c/*` for code, `*n/*` for name and `*p/*` for price. For example, `addToMenu c/W09 n/Chicken Wings p/3.20` would add the item Chicken wings with code W09 and price 3.20 to the menu.
*** `deleteFromMenu`: The `deleteFromMenu` command allows the user to delete a menu item from the menu, but here the menu item is only identified by its code. For example, `deleteFromMenu W09` would delete the menu item with the code W09 from the menu.
** Justification: These commands in the menu feature would allow restaurant managers to edit the menu according to the ingredients they have available each day. The menu is also stored internally, and thus there would be no need to re-enter all the menu items but instead only add or remove a few menu items each day.
** Highlights: This enhancement works well with existing as well as future commands. The format of labelling for the `addToMenu` command was used for ease of distinguishing the name, code and price of the menu items. With the labels, users need not follow the format of keying in name, code then price and the command would work fine. However, the labelling approach was not needed for the `deleteFromMenu` command as the code is the only input needed.
** Credits: The addressbook given to us had originally used the labelling format for adding people to the addressbook, which is where I got my inspiration from for the `addToMenu` command.

* *Minor enhancement*: I added the ability to store the quantity ordered for each menu item in the menu, and update the
quantity ordered every time the bill is called, (implementation of `updateMenuItemQuantity` method).
** What it does: When a menu item is added for the first time, the quantity is automatically set to zero. It then
updates from zero every time the orders are confirmed (i.e. when the bill is called).
** Justification: This enhancement is to aid the future implementation of finding the most popular item in the menu, by
retrieving the menu item with the largest number of quantity ordered.
** Highlights: This enhancement works well with existing as well as future commands, and would help in future
implementation of finding out whether an item is sold out as well.

*Other contributions:*

* Project Management:
** There were a total of 2 releases, from version 1.2.1 to 1.3 and I managed both releases on GitHub.
** I was also in charge of scheduling and tracking, and managed the tracking of issues and milestones on GitHub.
* Documentation:
** Updated the User Guide and Developer Guide to reflect the commands related to the menu feature.
* Community:
** Offered suggestions on improvements to other teams' documentation in the class.

== Contributions to the User Guide

We had to make changes to the original addressbook User Guide with the instructions relevant to _RestOrRant_. The
following is an excerpt from our *RestOrRant User Guide* to show the updates that I have made for the menu features.

include::../UserGuide.adoc[tag=menumode]

== Contributions to the Developer Guide

We also had to make changes to the original addressbook Developer Guide as our implementation had major changes in the
UI, logic, model and storage components. The following is an excerpt from our *RestOrRant Developer Guide* to show the
updates that I have made for the menu features as well as the storage component.

include::../DeveloperGuide.adoc[tag=addtomenu]
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ public class AddToMenuCommand extends Command {
public static final String MESSAGE_SUCCESS = "New menu item added: %1$s";
public static final String MESSAGE_DUPLICATE_MENU_ITEM = "This item already exists in the menu";
public static final String MESSAGE_INCORRECT_MODE = "Incorrect Mode, unable to execute command. Enter menuMode";
public static final String MESSAGE_TOO_MANY_ITEMS = "RestOrRant can only accommodate 200 menu items!\n"
+ "Currently there are %1$s menu items.";
public static final int MAX_ALLOWED_ITEMS = 200;

private final MenuItem toAdd;

Expand All @@ -46,6 +49,11 @@ public CommandResult execute(Mode mode, Model model, CommandHistory history) thr
throw new CommandException(MESSAGE_DUPLICATE_MENU_ITEM);
}

if (model.getRestOrRant().getMenu().getMenuItemList().size() >= MAX_ALLOWED_ITEMS) {
throw new CommandException(String.format(MESSAGE_TOO_MANY_ITEMS,
String.valueOf(model.getRestOrRant().getMenu().getMenuItemList().size())));
}

model.addMenuItem(toAdd);
return new CommandResult(String.format(MESSAGE_SUCCESS, toAdd));
}
Expand Down

0 comments on commit aa37ca5

Please sign in to comment.