PROJECT: MeNUS

Overview

MeNUS is an all-in-one restaurant management desktop app designed to help restaurant owners and managers streamline the process of managing restaurants within National University of Singapore (NUS). With this app, users can manage their menus, sales, and even reservations!

This portfolio showcases my contributions to this project.

Summary of Contributions

  • Code contributed: RepoSense

  • Major enhancement: Added the Reservation Management feature

    • What it does: Allows the user to manage a Reservations List using various commands

    • Justification: It can be messy to manually manage restaurant reservations using pen and paper. This feature enables a systematic and reliable way to manage reservations.

    • Highlights: This project required me to communicate with my teammates to integrate our different management systems together. It required an in-depth analysis of the underlying MeNUS architecture.

    • Credits: Dates are parsed using Natty, a natural language date parser.

  • Minor enhancement: Added a way to add a command alias(a shortcut) to each command to allow users to type commands faster: #41.

  • Other contributions:

    • Project management:

      • Managed the documentation for the project team.

    • Documentation:

      • Wrote feature descriptions in the User Guide and Developer Guide.

      • Helped teammates edit language and phrasing in the User Guide and Developer Guide.

    • Community:

    • Tools:

      • Integrated a third party library (Natty) to the project #250.

Contributions to the User Guide

Given below are sections I contributed to the User Guide in relation to the Reservations Management feature. They showcase my ability to write documentation targeting end-users.

Reservations Management

Adding a reservation: add-reservation or ar

Adds a new reservation to the reservations list.
Format: add-reservation n/NAME px/PAX d/DATE ti/TIME or ar n/NAME px/PAX d/DATE ti/TIME

  • We use natural language processing to parse the date and time values

  • For example, phrases like 21st Dec or 12 p.m. will be accepted. Try it out!

  • Try to avoid ambiguous language as it might be interpreted incorrectly

  • For example, 3/12 is ambiguous as it could mean 3rd December or 12th March!

  • If you want to be sure, we recommend using these formats:

    • DATE: DD-MM-YYYY

    • TIME: HH:MM

  • Dates that have already passed will be rejected

Examples:

  • add-reservation n/TAN px/4 d/21-07-2019 ti/10:00

  • ar n/ONG px/2 d/21st July ti/10am

  • ar n/LEE px/8 d/next tuesday ti/8 p.m.

Listing all reservations : list-reservations or lr

Shows a list of all reservations in the reservations list.
Format: list-reservations or lr

Editing a reservation: edit-reservation or er

Edits an reservation in the reservation list.
Format: edit-reservation INDEX [n/NAME] [px/PAX] [d/DATE] [ti/TIME] or er INDEX [n/NAME] [px/PAX] [d/DATE] [ti/TIME]

  • Edits the reservation at the specified INDEX. The index refers to the index number shown in the displayed reservations 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.

Examples:

  • edit-reservation 2 d/31-12-2019 ti/18:00
    Edits the time of the 2nd reservation in the list to 31st Dec 2019, 1800 hrs.

  • er 6 n/ONG px/4
    Edits the name and pax of the 6th reservation to ONG and 4 respectively.

Sorting reservations list: sort-reservations or sortr

Sorts the reservations list by Date/Time.
Format: sort-reservations or sortr

Deleting a reservation: delete-reservation or dr

Deletes the specified reservation from the reservations list.
Format: delete-reservation INDEX or dr INDEX

  • Deletes the reservation at the specified INDEX.

  • The index refers to the index number shown in the displayed reservations list.

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

Examples:

  • list-reservations
    delete-reservation 2
    list-reservations
    Deletes the 2nd reservation in the reservations list.

  • list-reservations
    dr 5
    list-reservations
    Deletes the 5th reservation in the reservations list.

Selecting a reservation : select-reservation or sr

Selects the reservation identified by the index number used in the displayed reservations list.
Format: select-reservation INDEX or sr INDEX

  • Selects the reservation at the specified INDEX.

  • The index refers to the index number shown in the displayed reservation list.

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

Examples:

  • list-reservations
    select-reservation 2
    Selects the 2nd reservation in the reservations list.

  • list-reservations
    select-reservation 7
    Selects the 7th reservation in the reservations list.

Contributions to the Developer Guide

Given below are sections I contributed to the Developer Guide in relation to the Reservations Management feature. They showcase my ability to write technical documentation and the technical depth of my contributions to the project.

Reservations feature

The Reservations feature allows users to store customer reservations, view them, and to cancel them.

Current Implementation

The Reservations feature currently contains 6 commands to modify the UniqueReservationsList stored in ModelManager.

  • add-reservation command - Adds reservations to the reservations list.

  • edit-reservation command - Edits existing reservations in the reservations list.

  • delete-reservation command - Deletes existing reservations in the reservations list.

  • list-reservation command - Lists reservations in the reservations list.

  • select-reservation command - Select existing reservations in the reservations list.

  • sort-reservation command - Sorts existing reservations in the reservations list.

Each Reservation object contains Name, Pax, Date and Time.

add-reservation Command

The command takes in 3 parameters, Name, Pax,Date and Time to create a Reservation object.

The Date class will reject dates that have already passed the current date

Dates are parsed using the Natty Library

Due to the way Natty is implemented, Natty will try to parse dates in MM-DD-YYYY format
i.e. 03-11-2019 will be parsed as 11th March instead of 3rd November

As a temporary workaround, the Date class will check to see if the date entered is in the DD-MM-YYYY format

If it is, then it will be parsed using LocalDate.parse()
If not, it will continue use the Natty Library to parse the date value

After the Reservation Object is created, RestaurantBook#addReservation(Reservation reservation) is called to add the Reservation Object to the UniqueReservationsList.

The following activity diagram summarizes what happens when a user executes add-reservation command:

AddReservationActivityDiagram

Figure 4.9.2.1: Activity diagram to illustrate the add-reservation command

edit-reservation Command

The command takes in 1 mandatory parameter, Index, followed by 1 or more of the following optional parameters, Name, Pax, Date, Time.

The Reservation associated with the given Index is then identified within the internal UniqueReservationsList, then has its values updated to the new values specified by the Name, Pax,Date, and Time parameters.

delete-reservation Command

The command takes in 1 parameter, Index.

The Reservation associated with the given Index is then identified, then deleted from the internal UniqueReservationsList.

list-reservations Command

The command does not require any additional parameters.

A DisplayReservationListRequestEvent is posted to the EventsCenter, which will call the handleDisplayReservationListRequestEvent method of the MainWindow. The Reservations List will then be shown on the UI.

The following sequence diagram shows how the list-reservations command works:

ListReservationsSequenceDiagram

Figure 4.9.5.1: Sequence diagram to illustrate the list-reservations command

Design Considerations

Aspect: How Date and Time are parsed

  • Alternative 1 (current choice): Date and Time are parsed using Natty.

    • Pros: Easy to implement as it only requires importing the Natty library with minimal configuration.

    • Cons: Natty will sometimes try to "guess" unexpected Date values.

  • Alternative 2: Configure the Natty library to avoid unexpected parse results.

    • Pros: The parser will be able to provide more accurate Date and Time values.

    • Cons: Difficult to implement as it requires deep understanding of how the Natty library works.

Use case: UC401 - Add reservation

MSS

  1. User requests to add a new reservation.

  2. App adds the reservation to the reservations list.

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

    Use case ends.

Extensions

  • 2a. The reservation date or time entered has an incorrect format.

    • 2a1. App returns a message telling user the date or time format is entered incorrectly.

    • 2a2. User requests to add reservation again.

      Steps 2a1-2a2 are repeated until a proper date and time are entered.

      Use case resumes at step 3.

Use case: UC402 - Edit reservation

MSS

  1. User requests to edit a specified reservation.

  2. App edits the specified reservation with the updated values.

  3. App returns a success message confirming the specified reservation has been edited.

    Use case ends.

Extensions

  • 1a. The given index is invalid.

    • 1a1. App returns a message telling user that the index is invalid.

    • 1a2. User requests to edit reservation again.

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

      Use case resumes at step 2.

  • 1b. None of the optional fields are specified.

    • 1b1. App returns a message telling user at least one optional field has to be specified.

    • 1b2. User requests to edit reservation again.

      Steps 1b1-1b2 are repeated until at least one optional field is entered.

      Use case resumes at step 2.

Use case: UC403 - Delete reservation

MSS

  1. User requests to list reservations.

  2. App shows a list of reservations.

  3. User requests to delete a specific reservation in the list.

  4. App deletes the reservation.

    Use case ends.

Extensions

  • 2a. The list is empty.

    Use case ends.

  • 3a. The given index is invalid.

    • 3a1. App returns a message telling user the index is invalid.

    • 3a2. User requests to delete reservation again.

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

      Use case resumes at step 3.

Reservations Management

  1. Adding a reservation

    1. Prerequisites: The reservation to be added must not be a duplicated entry in the reservations list and the user must be logged in.

    2. Test case: add-reservation n/John Doe px/4 d/05-12-2019 ti/10:00 t/Driving
      Expected: Reservation will be added into the reservation list. Details of the added reservation will be shown.

    3. Test case: add-reservation n/
      Expected: Reservation will not be added. Improper format error details shown.

    4. Test case: add-reservation n/John Doe px/4 d/01-01-2018 ti/10:00 t/Driving
      Expected: Reservation will not be added. "Date should not have passed" error will be shown.

    5. Other incorrect add-reservation commands to try: add-reservation, add-reservation n/John Doe px/4@ d/05-12-2019 ti/10:00
      Expected: Reservation will not be added. Improper format error details shown.

  2. Listing reservations

    1. Prerequisites: The user must be logged in.

    2. Test case: list-reservations
      Expected: The reservations list will be shown.

  3. Selecting a reservation

    1. Prerequisites: The reservations list must contain at least 1 reservation.

    2. Test case: select-reservation 1
      Expected: Selects the reservation specified by the index in the reservations list. Index of the selected reservation will be shown.

    3. Incorrect commands to try: select-reservation, select-reservation all

  4. Editing a reservation

    1. Prerequisites: The reservation to be edited must be an existing entry in the reservations list and the user must be logged in.

    2. Test case: edit-reservation 1 d/06-10-2020
      Expected: Edited reservation will replace the existing reservation in the reservations list. Details of the edited reservation will be shown.

    3. Test case: edit-reservation n/
      Expected: No reservation is edited. Improper format error details shown.

    4. Other incorrect edit-reservation commands to try: edit-reservation , edit-reservation 1 px/4@
      Expected: Similar to previous.

  5. Deleting a reservation

    1. Prerequisites: The reservation to be deleted must be an existing entry in the reservations list and the user must be logged in.

    2. Test case: delete-reservation 1
      Expected: First reservation will be deleted from the list. Details of the deleted reservation will be shown.

    3. Test case: delete-reservation 0
      Expected: No reservations are deleted. Improper format error details shown.

    4. Other incorrect delete-reservation commands to try: delete-reservation, delete-reservation all
      Expected: Similar to previous.

  6. Sorting reservations

    1. Prerequisites: The user must be logged in and the reservations list must be populated with more than one entry.
      (and preferably be initially unsorted, to see the effects of the sort-reservations command)

    2. Setup: Enter these commands to populate the reservations list with an unsorted set of reservations.

      1. add-reservation n/Mandelbrot px/3 d/06-12-2019 ti/18:00

      2. add-reservation n/Benoit px/1 d/05-12-2019 ti/10:00

      3. add-reservation n/B px/2 d/05-12-2019 ti/12:00

    3. Test case: sort-reservations
      Expected: Reservations list will be sorted by Date/Time in ascending order.