PROJECT: MeNUS

This portfolio serves as a summary of my contributions for MeNUS.

Overview

MeNUS is an all-in-one restaurant management desktop application developed to help restaurant owners and managers streamline the process of managing restaurants. It allows the restaurant owners and managers to control their inventory, menu, sales and reservations efficiently all-in-one place. MeNUS is also designed to help restaurants save cost from running expensive and independent systems.

Restaurant owners interact with MeNUS using a Command Line Interface (CLI). It also has a Graphical User Interface(GUI) created with JavaFX. MeNUS is written using Java 9 with approximately 30 KLOC.

Summary of Contributions

  • Code contributed: RepoSense

  • Major enhancement: Added Menu Management feature

    • What it does: Enables the user to manage the menus with the various menu management commands.

    • Justification: It can be messy and tedious to manage menus manually. This feature helps users to streamline the process of managing menus by enabling them to modify the menus efficiently with just a single command.

    • Highlights: This enhancement integrates with some existing sales and ingredients management commands. It requires an in-depth analysis and understanding of MeNUS architecture to ensure that commands of each management feature is integrated properly together.

  • Minor enhancement: Added animation to the GUI (Pull request #214)

    • What it does: Plays the FadeTransition for a short duration when the user enters a command.

  • Other contributions:

    • Project management:

      • Maintained issue tracker

      • Managed the integration of the features for MeNUS. Ensured that each feature was properly integrated into MeNUS.

    • Enhancements to existing features:

      • Updated the JavaFX Cascading Style Sheets(CSS) theme (Pull request #178)

    • Documentation:

      • Added user stories, use cases and instructions for manual testing in the Developer Guide: #37, #114, #142, #282

      • Added menu management features description in User Guide and implementation in Developer Guide

    • Community:

      • PRs reviewed (with non-trivial review comments): #179, #183

      • Reported bugs and suggestions for other teams in the class: #138, #142, #145, #156

Contributions to the User Guide

The following sections below showcase extracts of my contributions to the User Guide and my ability to write documentation targeting end-users.

Adding an item to the menu: add-item or ai

Adds an item to the menu
Format: add-item n/ITEM_NAME p/ITEM_PRICE [t/TAG]…​

  • ITEM_NAME and ITEM_PRICE must be provided

  • An item can have any number of tags (including 0)

  • ITEM_NAME should only contain alphanumeric characters and spaces, and it should not be blank

  • ITEM_PRICE should only contain numbers(no negative), at most 2 decimal place and smaller than or equals to 2,147,483,647

  • You cannot add items with the same name

Examples:

  • add-item n/Burger p/2

  • ai n/Burger Set p/4.5 t/Set

Editing an item in the menu : edit-item or ei

Edits an existing item in the menu.
Format: edit-item INDEX [n/ITEM_NAME] [p/ITEM_PRICE] [t/TAG]…​

  • Edits the item at the specified INDEX. The index refers to the index number shown in the displayed item list

  • The index must be a positive integer 1, 2, 3, …​

  • At least one of the optional fields must be provided

  • Existing values will be updated to the input values

  • When editing tags, the existing tags of the item will be removed i.e adding of tags is not cumulative

  • You can remove all the item’s tags by typing t/ without specifying any tags after it

  • Editing item price will remove discount given by discount-item command

Examples:

  • edit-item 1 n/burger p/3
    Edits the name and price of the 1st item to be burger and 3 respectively.

  • ei 2 p/4 t/
    Edits the price of the 2nd item to be 4 and clears all existing tags.

Deleting an item by index: delete-item-index or dii

Deletes the specified item from the menu.
Format: delete-item-index INDEX [ei/INDEX]

  • Deletes the item(s) specified by INDEX

  • The index refers to the index number shown in the displayed item list

  • The index must be a positive integer 1, 2, 3, …​

  • You can delete a range of items by adding the ending index ei\INDEX

  • The ending index can not be smaller than starting index

Examples:

  • list-items
    delete-item-index 2
    Deletes the 2nd item in the menu.

  • fi Cheese
    dii 1 ei/3
    Deletes 1st item, 2nd item and 3rd item in the results of the find-item command.

Deleting an item by name: delete-item-name or din

Deletes the specified item from the menu.
Format: delete-item-name ITEM_NAME

  • Deletes the item by the specified ITEM_NAME

  • The ITEM_NAME must be in the menu

  • ITEM_NAME is case-insensitive. e.g burger will match Burger

Examples:

  • delete-item-name Apple Juice
    Deletes the Apple Juice item from the menu.

  • din Cheese Fries
    Deletes the Cheese Fries item from the menu.

Filter menu by tag: filter-menu or fm

Finds items whose tags match any of the given keywords.
Format: filter-menu KEYWORD [MORE_KEYWORDS]…​

  • The search is case insensitive. e.g burger will match Burger

  • Only filter by tag

  • Only full words will be matched e.g. Bur will not match Burger

  • Items with tags matching at least one keyword will be returned (i.e. OR search). e.g. drinks burger will return items that are tagged with drinks or burger

KEYWORD for filter-menu must be alphanumeric

Examples:

  • filter-menu monday
    Returns any item that contains tag monday

  • fm set monday
    Returns any item that contains tag set or monday

Giving a discount to an item : discount-item or dci

Gives the item identified by the index number used in the displayed item list a discount.
Format: discount-item INDEX|ALL [ei/INDEX] dp/PERCENTAGE

  • You can remove discount by typing 0 for the percentage

  • You can give a discount to all items in the displayed item list by typing ALL(case-insensitive) instead of a specified INDEX

  • You can give a discount to a range of items by adding the ending index ei\INDEX

  • The ending index can not be smaller than starting index

  • The percentage should only contain numbers(no negative), and it should be at most 2 digits(no decimal place)

Examples:

  • list-items
    discount-item 2 dp/20
    Give the 2nd item in the menu a 20% discount.

  • fi Cheese
    dci ALL dp/0
    Revert all items in the results of the find-item command to original price.

  • li
    dci 1 ei/3 dp/50
    Give the 1st item to the 3rd item in the menu a 50% discount.

Contributions to the Developer Guide

The following sections below showcase extracts of my contributions to the Developer Guide. They also showcase my ability to write technical documentation and the technical depth of my contributions to the project.

Menu management feature extends MeNUS with a menu and provides the users with the ability to add items to the menu, edit items and remove items from the menu.

Current Implementation

The menu is stored internally as items, which is a UniqueItemList object that contains a list of Item objects. The menu management feature implements the following operations:

  • add-item command — Adds an item to the menu. The item must not already exist in the menu.

  • edit-item command — Replaces the target item with the editedItem. Target item must be in the menu and editedItem must not be the same as another existing item in the menu.

  • delete-item-index or delete-item-name command — Removes the equivalent item(s) from the menu. The item(s) must exist in the menu.

  • list-items command — Lists all the items in the menu.

  • clear-menu command — Removes all items from the menu.

  • select-item command — Selects an item in the menu and loads the page of the selected item.

  • sort-menu — Sorts the menu by name or price. The user must specify the sorting method.

  • find-item command — Finds items whose names contain any of the given keywords.

  • filter-menu command — Finds items whose tags contain any of the given keywords.

  • today-special command — Finds items whose tags contain the DAY_OF_THE_WEEK.

  • discount-item command — Gives discount to the equivalent item(s) in the menu. The item(s) must exist in the menu.

  • recipe-item command — Adds a recipe to the equivalent item in the menu. The item must exist in the menu.

  • add-required-ingredients command —  Adds the required ingredients to the equivalent item in the menu. The item must exist in the menu.

Each Item object consists of Name, Price, Recipe, Set<Tag> and Map<IngredientName, Integer>

sort-menu Command

The sort-menu command is facilitated by SortMenuCommand and SortMenuCommandParser. The command takes in user input for the sorting method.

Currently only sort by name or price

The SortMenuCommandParser will parse the user input and checks if the input is valid. If the input is valid, it constructs an SortMenuCommand object.

If the input is not valid, it will throw a ParseException

The SortMenuCommand object will indirectly call the UniqueItemList#sortItemsByName() or UniqueItemList#sortItemsByPrice() and the sorts the menu. After sorting the menu, it will save the current state for undo/redo.

The following activity diagram summarizes what happens when a user executes sort-menu command:

SortMenuActivityDiagram

Figure 4.8.2.1: SortMenu Activity diagram

The following sequence diagram shows how the sort-menu command works:

SortMenuSequenceDiagram

Figure 4.8.2.2: SortMenu Sequence diagram

discount-item Command

The discount-item command is facilitated by DiscountItemCommand and DiscountItemCommandParser. The command takes in user input for discount percentage and index or the keyword all.

The DiscountItemCommandParser will parse the user input and checks if the input is valid. It will check if the keyword all is entered. If keyword all is entered, DiscountItemCommandParser will construct an DiscountItemCommand object with isAll set to true. If index or a range of index is entered, it will construct an DiscountItemCommand object with isAll set to false.

If the inputs are not valid, it will throw a ParseException

The DiscountItemCommand object will check if isAll is true. If isAll is true, it will give the discount to all items in the UniqueItemList. Otherwise, it will give the discount to the item(s) specified by the index or the range of index. The DiscountItemCommand object create an Item with discounted price and indirectly call UniqueItemList#setItem(Item target, Item editedItem) to update the Item with Item with discounted price. It will then save the current state for undo/redo.

The following activity diagram summarizes what happens when a user executes discount-item command:

DiscountItemActivityDiagram

Figure 4.8.3.1: DiscountItem Activity diagram

Design Considerations

Aspect: How Price is parsed
  • Alternative 1 (current choice): Price is parsed without the currency symbol.

    • Pros: Easy to implement.

    • Cons: Only able to display Price with $ with 2 decimal place.

  • Alternative 2: Allow users to enter the currency symbol

    • Pros: Able to display the different currencies.

    • Cons: Harder to parse as currencies have different decimal places. Additional checks need to be implemented to check if the currency symbol and price entered are valid.

Extracts of Use Case Section

Use case: UC301 - Add item to menu

MSS

  1. User requests to add item to menu.

  2. App adds the item to menu.

  3. App returns a success message confirming the new item has been added.

    Use case ends.

Extensions

  • 1a. Invalid argument given for the command.

    • 1a1. App shows an error message that item name or/and item price are invalid.

    • 1a2. User requests to add item to menu again.

      Steps 1a1-1a2 are repeated until valid item name and valid item price are entered.

      Use case resumes at step 2.

  • 1b. The item name entered is already in the menu.

    • 1b1. App shows an error message that the item name already exists.

    • 1b2. User requests to add item to menu again.

      Steps 1b1-1b2 are repeated until item name that does not exist in the menu is entered.

      Use case resumes at step 2.

Use case: UC302 - Delete item by index from menu

MSS

  1. User requests to list items.

  2. App shows a list of items in menu.

  3. User requests to delete a specific item in menu.

  4. App deletes the item.

  5. App returns a success message confirming the specified item has been deleted.

    Use case ends.

Extensions

  • 2a. The list is empty.

    Use case ends.

  • 3a. The given index is invalid.

    • 3a1. App shows an error message that the given index is invalid.

    • 3a2. User requests to delete a specific item in menu again.

      Steps 3a1-3a2 are repeated until a valid index is entered.

      Use case resumes at step 4.

  1. Adding a new item with valid name, price and tag

    1. Prerequisites: You must not have the item, specified in the test case below, in the menu.

    2. Test case: add-item n/Chicken Rice p/3 t/rice t/chicken
      Expected: Item is added to the menu. Details of the item shown in status message.

    3. Incorrect commands to try: add-item n/test p/string, add-item n/@@^&@ p/3

  2. Editing an item with valid name, price and tag

    1. Prerequisites: You must have at least 1 item in the menu.

    2. Test case: edit-item 1 n/Duck Rice p/3 t/rice t/duck
      Expected: Item specified by the index is updated with new details. New details of the item shown in status message.

    3. Incorrect commands to try: edit-item 1 n/test p/string, edit-item n/name p/3

  3. Deleting an item by index

    1. Prerequisites: You must have at least 1 item in the menu.

    2. Test case: delete-item-index 1
      Expected: Item specified by the index is deleted from the menu. Number of items deleted shown in status message.

    3. Incorrect commands to try: delete-item-index -2, delete-item-index string

  4. Deleting an item by name

    1. Prerequisites: You must have the item, specified in the test case below, in the menu.

    2. Test case: delete-item-name chicken rice
      Expected: Item specified by name is deleted from the menu. Details of the deleted item shown in status message.

    3. Incorrect commands to try: delete-item-name @@^&@