Overview
This portfolio is written to show my contributions to the RMS project.
Restaurant Management System (RMS) is a desktop application written in Java to help users manage a restaurant.
It has five main features:
-
Menu Management
-
Order Management
-
Customer Membership Management
-
Employee Management
-
Statistics
The interactions of this application with the users are implemented with a Command Line Interface (CLI) which prints out the results based on the command the user type in.
This project is morphed from the Address Book Level 3 created by SE-EDU initiative.
The application is developed by team F09-2 for the module CS2113T in the National University of Singapore (NUS).
The team consists of five people, with each people managing one of the five functionality of the program.
Summary of contributions
Implemented contributions
Major contribution
Added the functionality to manage orders
-
What it does: Allows the user to add, delete, clear and list orders in the restaurant system.
-
Justification: This feature is required for a restaurant to keep track of all orders made in the past and present. It allows conveniences in taking new orders and storing important data for future references.
-
Highlights: Not only does this feature requires implementation of an order list management system, it also requires a new order drafting system to make sure that the flow of adding new order feels natural and to avoid typing very long command line to add a new order. As a result, many commands were developed for this functionality.
-
Credits: The implementation of the order list is based on the code written for the person list in the Address Book Level 3 made by SE-EDU initiative.
Minor contributions
Display the entered input as part of the returning message
-
Makes it possible for users to check what is the recently entered input.
-
Helps user figure out any formatting error of the entered input.
-
Allows users to quickly copy the previous entered command.
-
Assist bug reporting by making both input and output appear at the same time.
Make the input command word cases insensitive
-
Prevent error caused by case insensitive commands.
Proposed Idea For Future Implementations
Implement a state control system
-
What it does: Allows the user to access a specific functionality in the RMS.
-
Justification: As there are many functionality in the RMS, having a state control system will make the flow of using the RMS feels more natural and less confusing.
Create short command keywords
-
What it does: Allows quicker input using shorter command keywords.
-
Justification: Some of the command keywords are quite long, making it easy to type it wrongly.
Other contributions
-
Project management:
-
Enhancements to existing features:
-
Documentation:
-
Community:
-
Made a proposal on how to each member can morph the code without creating too many merge conflicts.
-
PRs reviewed (with non-trivial review comments): #87, #88, #99, #144, #176, #185
-
Shared the problems our project had to the CS2113T forum discussions: 1, 2, 3, 4
-
Reported bugs and suggestions to the other team members: #79, #104
-
Reported bugs and suggestions for other teams in the class: 1, 2, 3, 4
-
-
Tools:
Contributions to the User Guide
Given below are sections I contributed to the User Guide. They showcase my ability to write documentation targeting end-users. |
Order
Add Order
To add a new order to the order list, a draft must be completed before adding it to the order list.
To do so, dishes must be added into the draft before it can be added into the order list after the draft is confirmed.
If the customer is a registered member, the customer’s information can be found in the member list and can be added into the order draft to use and accumulate member points once the order is confirmed.
-
Display Draft And Instruction For Adding New Order
Displays the current draft, steps to add an order and the list of order draft commands that can be used
Format:
addorder
-
Edit A Dish Item Of The Draft
By picking dishes from the last shown menu and state the quantity to be added, te dish items can be added, deleted or edited in the draft order.
-
If the quantity is set to 0, then the dish will be removed from the draft.
-
If the quantity is a positive integer, then the quantity of the dish will be set to quantity.
Format:
draftdish INDEX q/QUANTITY [INDEX q/QUANTITY]…
-
There must be no duplicated index in the input command.
-
The indexes refer to the index numbers shown in the last shown menu list.
-
The indexes must be non-negative integers.
-
The quantities must be non-negative integers of 1-3 digits.
-
-
Select A Member As The Customer Of The Draft
This step is only necessary if the customer is a member.Select a member from the last shown member list to be the customer of the draft order.
Format:
draftcustomer INDEX
-
The index refers to the index number shown in the last shown member list.
-
-
Redeems member points in the draft order
This step can only be done after the following conditions have been met:-
A member has been added to the draft order.
-
At least one dish has been added to the draft order.
Assign member points to be redeemed as discount for the draft order.
Format:
draftpoints POINTS
-
The points redeemed must be a non-negative integer.
-
The limit to the redeemable points is set as the smaller value between the amount of points the customer currently has and the maximum amount of points can be deduced from the order such that the final price is not less than zero.
-
If the assigned redeemed points is more than the limit, then it will be set back to the limit.
-
-
-
Clear Draft
Clear all details of the draft order.
Format:
cleardraft
-
ConfirmDraft
Confirm the draft and add it to the order list.
Once it is confirmed, the ordered dish items in the newly added order can no longer be changed.
Format:
confirmdraft
Delete Order
Delete an order.
The deleted order is specified by the index of that order on the last displayed order list.
Format: deleteorder INDEX
-
The index refers to the index number shown in the last shown order list.
List Orders
Shows a list of all the current orders.
Each order include details of: customer, ordered time, total price and the list of dish items and quantities ordered
Format: listorder
.
Contributions to the Developer Guide
Given below are sections I contributed to the Developer Guide. They showcase my ability to write technical documentation and the technical depth of my contributions to the project. |
Logic component
API :
Logic.java
-
Logic
uses theParser
class to parse the user command. -
This results in a
Command
object which is executed byLogic
. -
The command execution can affect the
Data
(e.g. adding a new member) and/or raise events. -
The result of the command execution is encapsulated as a
CommandResult
object which is passed back to theUi
.
Each of the CommandResult class is used as a specific constructor to correctly handle the class of the returned list
of result.e.g. OrderCommandResult constructs a CommandResult object that only contains a result message and a list of orders
generated from the ordering commands.
|
Implementation
This section describes some noteworthy details on how certain features are implemented.
Adding a new order
To avoid writing a long command line when ordering a long list of dishes, a draft order system was implemented.
-
When the ordering draft is initialized or cleared, the member
draftOrder
inRms.txt
is loaded with a new object of classOrder
. It is initialize with an empty list of dish and a pseudo-empty customer field that is notnull
. -
By using the draft order command classes, the ordering draft can be edited (e.g. picking the customer from the member list if they present their membership card, pick the dish from the menu list one by one before confirming the order).
-
Once an order is confirmed, the ordering time is recorded and the total price is calculated to create a new
Order
object that has the same customer and list of dishes fields as the ordering draft to be added to the order list, the member points of the customer is updated, and the ordering draft is cleared afterward.
Providing the option for members to accumulate and redeem points
To allow members in the RMS to accumulate and redeem points when an order is made, the command draftpoints
was implemented.
-
As long as the customer and list of dish fields are not empty, the command
draftpoints
can be used to add a Points object from the Member class into the draft order. A new Points object will be created to store the points that the user wishes to redeem. Once the order is confirmed, the Points object in the Member class that was added by using thedraftcustomer
command will be updated. The member list will then show the newly updated points of that member while the order list will reflect the points that the member has earned from the order. The final price of the order will be calculated based on the price of each dish multiplied by the quantity and also take into account the number of points redeemed.
Saving and Loading the order list
The order list is saved by using an adaptive class that convert the existing data in the objects to a jaxb-friendly class. This means that the order list stores every information of the owner of an order.
However, the loading the order list cannot be implemented by creating a list of new Order
objects that contains a new
Member
object in its customer field based on the data stored in the storage file. This is because the created
customer object are not the same object as the original Member
object in the member list, so any changes made to the
member list will not get reflected in the order (e.g. not showing the changes of address or phone number if these
fields are to be recorded to the membership database).
To solve this problem, the order list will retrieve the correct object in the loaded member list at the start of the
program using the method retrieveMember()
in AdaptedOrder.java
.
[Proposed] Program State Control
As there is multiple functionality in the program, it is proposed that a program state control functionality should be implemented to assist the user navigate through the program. The command keywords can be simplified and the help message can be specifically wrote in each states to reduce the burdens of remembering very long line of commands.
This can be done by introducing a status variable in the Logic
module, creating command to change the state variable
and adjusting the returning command in the Parser
based on that variable.