Developer Guide
- Introduction
- Acknowledgements
- Setting up, getting started
- Design
- Implementation
- Documentation, logging, testing, configuration, dev-ops
- Appendix 1: Requirements
-
Appendix 2: Instructions for manual testing
- Launch and shutdown
- Opening help window
- Listing out all members
- Adding new member
- Finding members by [field]
- Editing member [field] by member ID
- Showing member profile
- Logging in as a manager
- Adding transaction by member ID
- Adding reservation by member ID
- Sorting members by credit in [field]
- Deleting transaction by member ID and transaction ID
- Deleting reservation by member ID and reservation ID
- Deleting member by member ID
- Clearing the program
- Exiting the program
- Saving data
- Appendix 3: Effort
- Appendix 4: Limitations and Future improvements
Introduction
This document is the developer guide for ezFoodie, an member manamgement application for restaurant managers and staffs.
This developer guide serves to provide developers with an understanding on how ezFoodie is designed and developed.
Acknowledgements
This project developed based on the Address Book Product Website project. Which is a part of the se-education.org initiative.
The icons of the project were obtained from ezfoodie_icon, member_icon, summary_icon
Libraries used:
If you would like to contribute code to this project, see se-education.org for more information.
Setting up, getting started
Refer to the guide Setting up and getting started.
Design
.puml files used to create diagrams in this document can be found in the diagrams folder. Refer to the PlantUML Tutorial at se-edu/guides to learn how to create and edit diagrams.
Architecture

The Architecture Diagram given above explains the high-level design of the App.
Given below is a quick overview of main components and how they interact with each other.
Main components of the architecture
Main has two classes called Main and MainApp. It is responsible for,
- At app launch: Initializes the components in the correct sequence, and connects them up with each other.
- At shut down: Shuts down the components and invokes cleanup methods where necessary.
Commons represents a collection of classes used by multiple other components.
The rest of the App consists of four components.
-
UI: The UI of the App. -
Logic: The command executor. -
Model: Holds the data of the App in memory. -
Storage: Reads data from, and writes data to, the hard disk.
How the architecture components interact with each other
The Sequence Diagram below shows how the components interact with each other for the scenario where the user issues the command del -mem/ -i/1.

Each of the four main components (also shown in the diagram above),
- defines its API in an
interfacewith the same name as the Component. - implements its functionality using a concrete
{Component Name}Managerclass (which follows the corresponding APIinterfacementioned in the previous point.
For example, the Logic component defines its API in the Logic.java interface and implements its functionality using the LogicManager.java class which follows the Logic interface. Other components interact with a given component through its interface rather than the concrete class (reason: to prevent outside component’s being coupled to the implementation of a component), as illustrated in the (partial) class diagram below.

The sections below give more details of each component.
UI component
The API of this component is specified in Ui.java

Structure of the UI Component MainWindow

Structure of the UI Component MemberListPanel

Structure of the UI Component MemberViewWindow

Structure of the UI Component SummaryWindow

Structure of the UI Component HelpWindow
The UI consists of a MainWindow that is made up of parts e.g.CommandBox, ResultDisplay, MemberListPanel, StatusBarFooter etc. All these, including the MainWindow, inherit from the abstract UiPart class which captures the commonalities between classes that represent parts of the visible GUI.
The UI component uses the JavaFx UI framework. The layout of these UI parts are defined in matching .fxml files that are in the src/main/resources/view folder. For example, the layout of the MainWindow is specified in MainWindow.fxml
The UI component,
- executes user commands using the
Logiccomponent. - listens for changes to
Modeldata so that the UI can be updated with the modified data. - keeps a reference to the
Logiccomponent, because theUIrelies on theLogicto execute commands. - depends on some classes in the
Modelcomponent, as it displaysMemberobject residing in theModel.
Logic component
API : Logic.java
Here’s a (partial) class diagram of the Logic component:

How the Logic component works:
- When
Logicis called upon to execute a command, it uses theEzFoodieParserclass to parse the user command. - This results in a
Commandobject (more precisely, an object of one of its subclasses e.g.,AddMemberCommand) which is executed by theLogicManager. - The command can communicate with the
Modelwhen it is executed (e.g. to add a member). - The result of the command execution is encapsulated as a
CommandResultobject which is returned back fromLogic.
The Sequence Diagram below illustrates the interactions within the Logic component for the execute("del -mem/ -i/1") API call.

DeleteCommandPrefixParser. DeleteMemberCommandParser and DeleteMemberCommand should end at the destroy marker (X) but due to a limitation of PlantUML, the lifeline reaches the end of diagram.
Here are the other classes in Logic (omitted from the class diagram above) that are used for parsing a user command:
How the parsing works:
-
UVWis a placeholder for the specific type of the command e.g.,add,editandredeem -
XYZis a placeholder for the specific object of the command e.g.,member,transactionandreservation - All
UVWXYZCommandParserclasses with the same type (e.g.,UVWMemberCommandParser,UVWTransactionCommandParser, …) extend from theUVWCommandParserabstract class so that they can be treated similarly where possible e.g, during testing. - All
UVWXYZCommandParserclasses (e.g.,AddMemberCommandParser,DeleteMemberCommandParser, …) inherit from theParserinterface so that they can be treated similarly where possible e.g, during testing.

- Case1:
add,edit,redeemanddeletecommands- When called upon to parse a user command, the
EzFoodieParserclass creates aUVWCommandPrefixParser(e.g.,AddCommandPrefixParser) which uses the other classes shown above to parse the user command by the specific object of the command (e.g.,member,transactionandreservationforAddCommandParsercorrespond toAddMemberCommandParser,AddTransactionCommandParserandAddReservationCommandParserrespectively) and create aUVWXYZCommandParserwhich extends fromUVWXCommandParser(e.g.,AddMmeberCommandParserextends fromAddCommandParser). - Then the
UVWXYZCommandParser(e.g.,AddMmeberCommandParser) uses the other classes shown above to parse the user command further and create aUVWXYZCommandobject (e.g.,AddMmeberCommand) which theEzFoodieParserreturns back as aCommandobject.
- When called upon to parse a user command, the

- Case2:
find,show,list,sort,loginandsetAccountcommands- When called upon to parse a user command, the
EzFoodieParserclass creates aUVWCommandParser(e.g.,FindCommandParser) which uses the other classes shown above to parse the user command and create aUVWCommandobject (e.g.,FindCommand) which theEzFoodieParserreturns back as aCommandobject.
- When called upon to parse a user command, the
- Case3:
clear,exit,logout,helpandsummarycommands- When called upon to parse a user command, the
EzFoodieParserclass creates aUVWCommandobject directly (e.g.,ClearCommand) which theEzFoodieParserreturns back as aCommandobject.
- When called upon to parse a user command, the
Model component
API : Model.java

The Model component,
- stores the ezFoodie data i.e., all
Memberobjects (which are contained in aUniqueMemberListobject). - stores the currently ‘selected’
Memberobjects (e.g., results of a search query) as a separate filtered list which is exposed to outsiders as an unmodifiableObservableList<Member>that can be ‘observed’ e.g. the UI can be bound to this list so that the UI automatically updates when the data in the list change. - stores a
UserPrefobject that represents the user’s preferences. This is exposed to the outside as aReadOnlyUserPrefobjects. - does not depend on any of the other three components (as the
Modelrepresents data entities of the domain, they should make sense on their own without depending on other components)
Reservation list in the EzFoodie, which Member references. This allows EzFoodie to only require one Reservation object per unique reservation, instead of each Member needing their own Reservation objects.
Storage component
API : Storage.java

The Storage component,
- can save both ezFoodie data and user preference data in json format, and read them back into corresponding objects.
- inherits from
AccountStorage,EzFoodieStorageandUserPrefStorage, which means it can be treated as either one (if only the functionality of only one is needed). - depends on some classes in the
Modelcomponent (because theStoragecomponent’s job is to save/retrieve objects that belong to theModel)
Common classes
Classes used by multiple components are in the seedu.address.commons package.
Implementation
This section describes some noteworthy details on how certain features are implemented.
Find feature
[written by: Hu Jiajun]
Implementation
Given below is an example usage scenario and how the find mechanism behaves at each step.
-
The user executes
find -mem/ -id/00001command to find the member with the member id00001in the application. -
The command is handled by
LogicManager#execute(String), which then calls and passes this command to theEzFoodieParser#parseCommand(String)method. -
The
EzFoodieParserdetects the command wordfindin the string and extracts the argument string-mem/ -id/00001. -
The
EzFoodieParsercreates a newFindCommandParserinstance to parse the argument string according to the format specified forFindCommand. -
The argument string is parsed to the member ids array
[00001]using theFindCommandParser#parse(String)method, which also performs validation. -
The
FindCommandParsercreates a newIdContainsKeywordsPredicateinstance with the member ids array[00001]to handle the filter. -
The
FindCommandParsercreates a newFindCommandinstance with theIdContainsKeywordsPredicateinstance and returns it toEzFoodieParser, which in turn returns it toLogicManager. -
The
LogicManagercalls theFindCommand#execute(Model)method. -
The
FindCommandcalls theModel#updateFilteredMemberList(IdContainsKeywordsPredicate)method. -
The
Modelcalls theFilteredList#setPredicate(IdContainsKeywordsPredicate)to filter the member by the member id00001 -
The application lists the filtered member.
-
Lastly, the
FindCommandcreates aCommandResultwith aSuccessMessageand returns it toLogicManager.
The above process is shown in the following sequence diagram:

Sequence diagram showcasing the find command process
FindCommandParser, IdContainsKeywordsPredicate and FindCommand should end at the destroy marker (X) but due to a limitation of PlantUML, the lifeline reaches the end of diagram.
The following activity diagram summarizes what happens when a user executes a new command to find the members by keywords:

Activity diagram showcasing the find command execution flow
Design consideration
Aspect: How to execute different types of keywords with FindCommand
-
Alternative 1 (current choice): Add corresponding constructors for different types of keywords.
- Pros: Easy to implement, only need to make a few changes to the source code.
- Cons: Insufficient use of object-oriented features (inheritance and polymorphic).
-
Alternative 2: Abstract
FindCommand, create different classes according to different types of keywords to inheritFindCommand, such asFindIdCommand,FindNameCommand,FindEmailCommand, etc.- Pros: Sufficient use of object-oriented features (inheritance and polymorphic).
- Cons: Have to make more changes to the source code, it may cause potential bugs.
Sort feature
[written by: Hu Jiajun]
Implementation
Given below is an example usage scenario and how the sort mechanism behaves at each step.
-
The user executes
sort -mem/ -c/ -a/command to sort the members by their credits in ascending order in the application. -
The command is handled by
LogicManager#execute(String), which then calls and passes this command to theEzFoodieParser#parseCommand(String)method. -
The
EzFoodieParserdetects the command wordsortin the string and extracts the argument string-mem/ -c/ -a/. -
The
EzFoodieParsercreates a newSortCommandParserinstance to parse the argument string according to the format specified forSortCommand. -
The argument string is parsed to
a(ascending order) and converted to the enum tpyeSortStatus.ASCusing theSortCommandParser#parse(String)method, which also performs validation. -
The
SortCommandParsercreates a newCreditSortComparatorinstance with the enum tpyeSortStatus.ASCto handle the sort. -
The
SortCommandParsercreates a newSortCommandinstance with theCreditSortComparatorinstance and returns it toEzFoodieParser, which in turn returns it toLogicManager. -
The
LogicManagercalls theSortCommand#execute(Model)method. -
The
SortCommandcalls theModel#updateSortedMemberList(CreditSortComparator)method. -
The
Modelcalls theSortedList#setComparator(CreditSortComparator)method to sort the members by their credits in ascending order -
The application lists the sorted members.
-
Lastly, the
SortCommandcreates aCommandResultwith aSuccessMessageand returns it toLogicManager.
The above process is shown in the following sequence diagram:

Sequence diagram showcasing the sort command process
SortCommandParser, CreditSortComparator and SortCommand should end at the destroy marker (X) but due to a limitation of PlantUML, the lifeline reaches the end of diagram.
The following activity diagram summarizes what happens when a user executes a new command to sort the members by their credits:

Activity diagram showcasing the sort command execution flow
Design consideration
Aspect: How to sort by different types of fields with SortCommand
-
Alternative 1 (current choice): Add corresponding constructors for different types of fields.
- Pros: Easy to implement, only need to make a few changes to the source code.
- Cons: Insufficient use of object-oriented features (inheritance and polymorphic).
-
Alternative 2: Abstract
SortCommand, create different classes according to different types of fields to inheritSortCommand, such asSortPointCommand,SortCreditCommand, etc.- Pros: Sufficient use of object-oriented features (inheritance and polymorphic).
- Cons: Have to make more changes to the source code, it may cause potential bugs.
Add Transaction feature
[written by: Yang Yuzhao]
Implementation
Given below is an example usage scenario and how adding transaction behaves at each step.
-
The user executes
add -txn/ -b/23.00 -id/00001command to add a transaction of billing amount23.00to the member with member ID00001in ezFoodie. -
The command is handled by
LogicManager#execute(String), which then calls and passes this command to theEzFoodieParser#parseCommand(String)method. -
The
EzFoodieParserdetects the command wordaddin the string and extracts the argument string-txn/ -b/23.00 -id/00001. -
The
EzFoodieParsercreates a newAddCommandPrefixParserinstance to parse the argument string according to the format specified forAddCommand. -
The
AddCommandPrefixParserdetects the prefix word-txn/by the methodAddCommandPrefixParser#parse(arguments)called and creates a newAddTransactionCommandParserinstance to parse the rest of the argument string. -
The
AddTransactionCommandParserprefixes-b/and-id/by the methodAddTransactionCommandParser#parser(arguments)called nd parse them intobillingandmemberIdthroughParserUtil#parseBillingandParserUtil#parseMemberId. -
The
AddTransactionCommandParser#parser(arguments)callsParserUtil#parseTimestampto create a newTimeStampinstancetimestampandParserUtil#parseTransactionIdto create a newIdinstancetransactionId, and creates a newTransactionobjecttransactionwithbilling,timestampandtransactionId. -
The
AddTransactionCommandParser#parser(arguments)creates a newAddTransactionCommandinstance withtransactionandmemberIdand returns it toezFoodieParserwhich in turn returns it toLogicManager. -
The
LogicManagercalls theAddTransactionCommand#execute(Model)method. -
The
AddTransactionCommandcallsModel#getUpdatedMemberList()and searches the list to find the member with the respectivememberIDto obtainmemberToEdit. -
The
AddTransactionCommandcallsAddTransactionCommand#createEditedMember(memberToedit, transaction)to obtaineditedMember. -
The
AddTransactionCommandcallsModel#setMember(memberToEdit, editedMember)to replace the old member with new transaction details. -
The
AddTransactionCommandcallsModel#updateFilteredMemberList(PREDICATE_SHOW_ALL_MEMBERS)to update the edited member in the member list. -
The application lists the updated member list.
-
Lastly, the
AddTransactionCommandcreates a new instance ofCommandResultwith a success message, and returns it toLogicManager.
The above process is shown in the following sequence diagram:

Show Member Profile feature
[written by: Yang Yuzhao]
Implementation
Given below is an example usage scenario and how showing member profile behaves at each step.
-
The user executes
show -mem/ -id/00001command to show the details of member with member ID00001in ezFoodie in a separate window. -
The command is handled by
LogicManager#execute(String), which then calls and passes this command to theEzFoodieParser#parseCommand(String)method. -
The
EzFoodieParserdetects the command wordshowin the string and extracts the argument string-mem -id/00001. -
The
EzFoodieParsercreates a newViewCommandParserinstance to parse the argument string according to the format specified forViewCommand. -
ViewCommandParsercallsViewCommandParser#parse()to parse the arguments into a newIdinstanceidusingParserUtil#parseMemberId(String). -
A new String array
idKeywordsis created byvalueattribute ofid. -
ViewCommandParsercreates a newViewCommandinstance with a newIdContainsKeywordsPredicatecreated usingidKeywordsand returns it toezFoodieParserwhich in turn returns it toLogicManager. -
The
LogicManagercalls theViewCommand#execute(Model)method. -
The
ViewCommandcallsModel#updateFilteredMemberListForView(IdContainsKeywordsPredicate)to update thefilteredMembersForViewinModelManagerwith filtered member to show. -
The
ViewCommandcreates a new instance ofCommandResultwith a success message and a true value forshowMemberView, and returns it toLogicManager. -
The application opens a separate
MemberViewWindowwith this member’s profile.
Summary feature
[written by: Yang Yuzhao]
Implementation
Given below is an example usage scenario and how showing summary behaves at each step.
-
The user executes
summarycommand to show statistics aboutMemberexisting in ezFoodie as well as time-series statistics ofTransactiondata. -
The command is handled by
LogicManager#execute(String), which then calls and passes this command to theEzFoodieParser#parseCommand(String)method. -
The
EzFoodieParserdetects the command wordsummaryin the string. -
LoginStatus.getLoginStatus()is called to check whether the user has logged in as a manager. If not, a newPermissionExceptioninstance will be thrown withMESSAGE_PERMISSION_DENIED. -
If the user has logged in as a manager,
EzFoodieParsercreates a newSummaryCommandinstance and returns it toezFoodieParserwhich in turn returns it toLogicManager. -
The
LogicManagercalls theSummaryCommand#execute(Model)method. -
The
ViewCommandcreates a new instance ofCommandResultwith a success message and a true value forshowSummary, and returns it toLogicManager. -
The application opens a separate
SummaryWindowwith statistics to show.
The above process is shown in the following sequence diagram:

Add member feature
[written by: Zhang Zhiyao]
Implementation
Given below is an example usage scenario and how the adding members behaves at each step.
-
The user executes
add -mem/ -n/John Doe -p/98765432 -e/johndoe@gmail.com -a/112 Amoy Street, 069907, Singaporecommand to add a memberJohn Doein the Ezfoodie and its’ storage. -
The command is handled by
LogicManager#execute(String), which then calls and passes this command to theEzFoodieParser#parseCommand(String)method. -
The EzFoodieParser detects the command word
addin the string and extracts the argument string-mem/ -n/John Doe -p/98765432 -e/johndoe@gmail.com -a/112 Amoy Street, 069907, Singapore. -
The
EzFoodieParsercreates a newAddCommandPrefixParserinstance to parse the argument string according to the format specified forAddCommandand callsAddCommandPrefixParser#parse(arguments). -
AddCommandPrefixParser#parse(arguments)detects the prefix-mem/and creates a new instance ofAddMemberCommandParserand callsAddMemberCommandParser#parse(arguments). -
AddMemberCommandParser#parse(arguments)detects the prefixes-n/,-p/,-e/and-a/and parses them throughParseUtilto obtain thename,phone,emailandaddress. -
Through the
ParseUtil, it will get defaulttimestamp,credit,point,tagList,transactionListandreservationList. -
Using the obtained
name,phone,email,address,timestamp,credit,point,tagList,transactionListandreservationList. a new instance ofMemberis created. -
Using a new instance
Member, a new instance ofAddMemberCommandis created and returned toezFoodieParserwhich in turn returns it toLogicManager. -
LogicManagercalls theAddMemberCommand#execute(Model)method. -
Lastly,
AddMemberCommandcreates a new instance ofCommandResultwith a success message, and returns it to Logic Manager.
Design consideration
What is the default value of timestamp ?
- default value is the timestamp auto registerred by system at fist time add in the member.
What is the default value of credit,point, tagList, transactionList and reservationList ?
- default value will all be set as 0 and empty list.
Update Credit feature
[written by: Zhang Zhiyao]
Implementation
Given below is an example usage scenario and how the redeem mechanism behaves at each step.
-
The user executes
add -txn/ -b/200.00 -id/00001command to add transaction. -
The command is handled by
LogicManager#execute(String), which then calls and passes this command to theEzFoodieParser#parseCommand(String)method. -
The EzFoodieParser detects the command word
addin the string and extracts the argument string-txn/ -b/200.00 -id/00001. -
The EzFoodieParser creates a new
AddCommandPrefixParserinstance to parse the argument string according to the format specified forAddCommandand callsAddCommandPrefixParser#parse(arguments). -
AddCommandPrefixParser#parse(arguments)detects the prefix-txn/and creates a new instance ofAddTransactionCommandParserand callsAddTransactionCommandParser#parse(arguments). -
AddTransactionCommandParser#parse(arguments)detects the prefixes-b/and ` -id/and parses them throughParseUtilto obtain thebilling amountand thememberID`. -
Using the obtained
billing amount, a new instance ofTransactionis created. According to thebilling amount, the credit has been updated.
Redeem point feature
[written by: Zhang Zhiyao]
Implementation
Given below is an example usage scenario and how the redeem mechanism behaves at each step.
-
when user redeem point, the user executes
redeem -rd/100 -id/00001command。 -
The command is handled by
LogicManager#execute(String), which then calls and passes this command to theEzFoodieParser#parseCommand(String)method. -
The EzFoodieParser detects the command word
redeemin the string and extracts the argument string-rd/100 -id/00001. -
The EzFoodieParser creates a new
RedeemCommandParserinstance to parse the argument string according to the format specified forRedeemCommand, and callsRedeemCommandParser. -
The
RedeemCommandParserdetects the prefixes-b/,-id/and parses them throughParseUtilto obtain thebilling amount, thememberID. -
Using the obtained
billing amount, theRedeemCommandwill execute and update related point. then return a newMemberwith updated point.
Add reservation
[written by: Raja Sudalaimuthu Mukund]
Implementation
Given below is an example usage scenario and how the add reservation mechanism behaves at each step.
-
The user executes
add -rs/ -dt/2021-01-01 00:00 -rm/2 people -id/10001command to add a reservation for 2 people at 2021-01-01 00:00 hrs to member id 10001’s reservation list. -
The command is handled by
LogicManager#execute(String), which then calls and passes this command to theEzFoodieParser#parseCommand(String)method. -
The EzFoodieParser detects the command word
addin the string and extracts the argument string-rs/ -dt/2021-01-01 00:00 -rm/2 people -id/10001. -
The EzFoodieParser creates a new
AddCommandPrefixParserinstance to parse the argument string according to the format specified forAddCommandand callsAddCommandPrefixParser#parse(arguments). -
AddCommandPrefixParser#parse(arguments)detects the prefix-rs/and creates a new instance ofAddReservationCommandParserand callsAddReservationCommandParser#parse(arguments). -
AddReservationCommandParser#parse(arguments)detects the prefixes-dt/,-rm/and-id/and parses them throughParseUtilto obtain thedateTime,remarkand thememberID. -
Using the obtained
dateTimeandremark, a new instance ofReservationis created. -
Using the new instance of
Reservationand the obtainedmemberID, a new instance ofAddReservationCommandis created and returned to ezFoodieParser which in turn returns it toLogicManager. -
LogicManagercalls theAddReservationCommand#execute(Model)method. -
The
AddReservationCommandcallsModel#getUpdatedMemberList()and searches the list to find the member with the respectivememberIDto obtainmemberToEdit. -
The
AddReservationCommandcallsModel#createUpdatedReservations(memberToEdit, reservationToAdd)to create a new instance of the same member but with the new reservation added to the member’s reservation list. -
The
AddReservationCommandcallsModel#setMember(memberToEdit, editedMember)to replace the old instance of the member with its new instance. -
The
AddReservationCommandcallsModel#updateFilteredMemberList(PREDICATE_SHOW_ALL_MEMBERS)to update the current member list with the updated member list. -
The application lists the updated member list.
-
Lastly,
AddReservationCommandcreates a new instance ofCommandResultwith a success message, and returns it to Logic Manager.

Design consideration
Delete Reservation Feature
[written by: Chen Shi Yao, Stephanie]
Implementation
Given below is an example usage scenario and how the delete reservation mechanism behaves at each step.
-
The user executes
del -rs/ -id/10001100001command to delete the reservation with reservationId 100001 for the member with ID 10001. -
The command is handled by
LogicManager#execute(String), which then calls and passes this command to theEzFoodieParser#parseCommand(String)method. -
The EzFoodieParser detects the command word
delin the string and extracts the argument string-rs/ -id/10001100001. -
The EzFoodieParser creates a new
DeleteCommandPrefixParserinstance to parse the argument string according to the format specified forDeleteCommandand callsDeleteCommandPrefixParser#parse(arguments). -
DeleteCommandPrefixParser#parse(arguments)detects the prefix-rs/and creates a new instance ofDeleteReservationCommandParserand callsDeleteReservationCommandParser#parse(arguments). -
DeleteReservationCommandParser#parse(arguments)detects the prefixes-id/and parses them throughParseUtilto obtain thememberIdandReservationId. -
Using the obtained
memberIDandReservationId, a new instance ofDeleteReservationCommandis created and returned to ezFoodieParser which in turn returns it toLogicManager. -
LogicManagercalls theDeleteReservationCommand#execute(Model)method. -
The
DeleteReservationCommandcallsModel#getUpdatedMemberList()and searches the list to find the member with the respectivememberIDto obtainmemberToEdit. -
Using the
reservationId, theDeleteReservationCommandthen searches the list ofReservationsassociated with thememberToEditto find thereservationToDelete. -
The
DeleteReservationCommandcallsDeleteReservationCommand#createEditedMember(memberToEdit, reservationToDelete)to create a new instance of the same member but with the reservation deleted from the member’s reservation list. -
The
DeleteReservationCommandcallsModel#setMember(memberToEdit, editedMember)to replace the old instance of the member with its new instance. -
The
DeleteReservationCommandcallsModel#updateFilteredMemberList(PREDICATE_SHOW_ALL_MEMBERS)to update the current member list with the updated member list. -
The application lists the updated member list.
-
Lastly,
DeleteReservationCommandcreates a new instance ofCommandResultwith a success message, and returns it to Logic Manager.

[Proposed] Undo/redo feature
Proposed Implementation
The proposed undo/redo mechanism is facilitated by VersionedEzFoodie. It extends EzFoodie with an undo/redo history, stored internally as an ezFoodieStateList and currentStatePointer. Additionally, it implements the following operations:
-
VersionedEzFoodie#commit()— Saves the current ezFoodie state in its history. -
VersionedEzFoodie#undo()— Restores the previous ezFoodie state from its history. -
VersionedEzFoodie#redo()— Restores a previously undone ezFoodie state from its history.
These operations are exposed in the Model interface as Model#commitEzFoodie(), Model#undoEzFoodie() and Model#redoEzFoodie() respectively.
Given below is an example usage scenario and how the undo/redo mechanism behaves at each step.
Step 1. The user launches the application for the first time. The VersionedEzFoodie will be initialized with the initial ezFoodie state, and the currentStatePointer pointing to that single ezFoodie state.

Step 2. The user executes del -mem/ -i/5 command to delete the 5th Member in the ezFoodie. The delete command calls Model#commitEzFoodie(), causing the modified state of the ezfoodie after the del -mem/ -i/5 command executes to be saved in the ezFoodieStateList, and the currentStatePointer is shifted to the newly inserted ezFoodie state.

Step 3. The user executes add -mem/ -n/John Doe … to add a new member. The add command also calls Model#commitEzFoodie(), causing another modified ezFoodie state to be saved into the ezFoodieStateList.

Model#commitEzFoodie(), so the ezFoodie state will not be saved into the ezFoodieStateList.
Step 4. The user now decides that adding the member was a mistake, and decides to undo that action by executing the undo command. The undo command will call Model#undoEzFoodie(), which will shift the currentStatePointer once to the left, pointing it to the previous ezFoodie state, and restores the ezFoodie to that state.

currentStatePointer is at index 0, pointing to the initial EzFoodie state, then there are no previous EzFoodie states to restore. The undo command uses Model#canUndoEzFoodie() to check if this is the case. If so, it will return an error to the user rather than attempting to perform the undo.
The following sequence diagram shows how the undo operation works:

UndoCommand should end at the destroy marker (X) but due to a limitation of PlantUML, the lifeline reaches the end of diagram.
The redo command does the opposite — it calls Model#redoEzFoodie(), which shifts the currentStatePointer once to the right, pointing to the previously undone state, and restores the ezFoodie to that state.
currentStatePointer is at index ezFoodieStateList.size() - 1, pointing to the latest ezFoodie state, then there are no undone EzFoodie states to restore. The redo command uses Model#canRedoEzFoodie() to check if this is the case. If so, it will return an error to the user rather than attempting to perform the redo.
Step 5. The user then decides to execute the command list -mem/. Commands that do not modify the ezFoodie, such as list -mem/, will usually not call Model#commitEzFoodie(), Model#undoEzFoodie() or Model#redoEzFoodie(). Thus, the ezFoodieStateList remains unchanged.

Step 6. The user executes clear, which calls Model#commitEzFoodie(). Since the currentStatePointer is not pointing at the end of the ezFoodieStateList, all ezFoodie states after the currentStatePointer will be purged. Reason: It no longer makes sense to redo the add -mem/ -n/John Doe … command. This is the behavior that most modern desktop applications follow.

The following activity diagram summarizes what happens when a user executes a new command:

Design considerations
Aspect: How undo & redo executes:
-
Alternative 1 (current choice): Saves the entire ezFoodie.
- Pros: Easy to implement.
- Cons: May have performance issues in terms of memory usage.
-
Alternative 2: Individual command knows how to undo/redo by itself.
- Pros: Will use less memory (e.g. for
delete, just save the member being deleted). - Cons: We must ensure that the implementation of each individual command are correct.
- Pros: Will use less memory (e.g. for
{more aspects and alternatives to be added}
[Proposed] Data archiving
{Explain here how the data archiving feature will be implemented}
Documentation, logging, testing, configuration, dev-ops
Appendix 1: Requirements
Product scope
Target user profile story:
Ben is a restaurant manager. He found that restaurants are becoming more and more popular, the number of members is increasing, and there are a large number of reservations every day. Every day the front desk staffs spend a lot of time in excel or paper to record new members, record reservations, and find reservations. With the need to handle multiple tasks at the same time, the staffs are also prone to make careless mistakes at work due to fatigue. 😞
More importantly, the member list is only stored in excel, it makes it difficult for Ben to manage and analyze members to formulate targeted promotional strategies, which will have bad impact on the profit expansion of the restaurant. 😞
As a manager who is proficient in technology and has commendable experience in Unix, Ben hopes to develop an easy-to-operate application to improve the work efficiency of himself and the staffs. 🤩
Target user profile summary:
Managers and staffs who
- work in a highly popular restaurant and the number of members is increasing
- are responsible for managing a large number of member registrations and reservations daily
- are required to multi-task (manage member registrations and reservations)
- need automatic reminder
- need to manage and analyze members to formulate promotional strategies
- are proficient in technology
- want to get things done quickly
- are tired of tracking member details from paper or excel
- prefer desktop apps over other types
- can type fast
- prefer typing to mouse interactions
- are reasonably comfortable using CLI apps
Value proposition:
helps restaurants keep track of their ever-growing list of members. Restaurant managers and staffs can easily view and update member status (e.g. personal information, tier, reservation, transaction, etc.) to manage and analyze members based on various criteria faster than a typical mouse/GUI driven application.
User stories
Priorities: High (must have) - * * *, Medium (nice to have) - * *, Low (unlikely to have) - *
| Priority | As a … | I want to … | So that I can … |
|---|---|---|---|
* * * |
staff | view help | easily check how to use the commands and access the user guide |
* * * |
staff | exit the program | |
* * * |
staff | list out all members | easily view and access the member basic information |
* * * |
staff | add new member | easily the track member statuses |
* * * |
staff | find members by name | easily find the specific members to check their details |
* * * |
staff | find member by phone | easily find the specific member to check his/her details |
* * * |
staff | find member by email | easily find the specific member to check his/her details |
* * * |
staff | find members by registration date | easily find a member to check their details |
* * * |
staff | find member by member ID | easily find the specific member to check his/her details |
* * * |
staff | show member profile | easily check the specific member’s details |
* * * |
staff | add transaction by member ID | easily track the transaction history of members |
* * * |
staff | redeem member’s points by member ID | easily provide promotional offers for frequent customers |
* * * |
staff | redeem member’s points by index number | easily provide promotional offers for frequent customers |
* * * |
staff | add reservation by member ID | easily reserve seats for the comming customers |
* * * |
manager | clear the program | initialize the entire program |
* * * |
manager | login as a manager | access manager-only features, e.g. sort the members by their credits |
* * * |
manager | logout as a manager | prevent staff from accessing manager-only features |
* * * |
manager | set login password | improve the program security |
* * * |
manager | sort members by credit | easily analyze the members’ consumption and distribution |
* * * |
manager | edit member name by member ID | update member information to latest |
* * * |
manager | edit member phone by member ID | update member information to latest |
* * * |
manager | edit member email by member ID | update member information to latest |
* * * |
manager | edit member address by member ID | update member information to latest |
* * * |
manager | edit member name by index number | update member information to latest |
* * * |
manager | edit member phone by index number | update member information to latest |
* * * |
manager | edit member email by index number | update member information to latest |
* * * |
manager | edit member address by index number | update member information to latest |
* * * |
manager | delete member by member ID | remove member that I no longer need |
* * * |
manager | delete member by index number | remove member that I no longer need |
* * |
staff | edit reservation by member ID and transaction ID | update reservation for member to latest |
* * |
manager | delete reservation by member ID and transaction ID | remove reservation for member that I no longer need |
* |
staff | retrieve previous commands | easily speed up the typing speed of command |
* |
manager | delete transaction by member ID and transaction ID | correct any accidental mistakes |
* |
manager | edit transaction by member ID and transaction ID | correct any accidental mistakes |
* |
manager | view summary for registrations and transactions | know the summary details in a certain period, e.g. total registrations |
{More to be added}
Use cases
(For all use cases below, the System is the ezFoodie and the Actor is the Staff or only the Manager, unless specified otherwise)
Use case: UC01 - View help
Actors: Staff
MSS
- Staff requests to view help.
-
ezFoodie shows a dialog contains how to use the commands and access the user guide.
Use case ends.
Extensions
-
1a. The given input is invalid.
-
1a1. ezFoodie shows an error message.
Use case ends.
-
Use case: UC02 - Exit the program
Actors: Staff
MSS
- Staff requests to exits the program.
-
ezFoodie exits.
Use case ends.
Extensions
-
1a. The given input is invalid.
-
1a1. ezFoodie shows an error message.
Use case ends.
-
Use case: - List out all members
Actors: Staff
MSS
- Staff requests to list out all members.
-
ezFoodie shows a list of members.
Use case ends.
Extensions
-
1a. The given input is invalid.
-
1a1. ezFoodie shows an error message.
Use case ends.
-
-
2a. The member list is empty.
Use case ends.
Use Case: UC04 - Add new member
Actors: Staff
MSS
- Staff requests to add the information of a member to the member list.
-
The member is added in ezFoodie with the given information.
Use case ends.
Extensions
-
1a. The given input is invalid.
-
1a1. ezFoodie shows an error message.
Use case ends.
-
-
1b. The member (phone or email) already exists in the member list.
-
1b1. ezFoodie shows an error message.
Use case ends.
-
Use case: - find a member by [field]
Actors: Staff
MSS
- Staff requests to find a member by [field] with keywords, [field] can be member ID, name, phone, email or registration date.
-
ezFoodie shows a list of members whose [field] matches the keywords.
Use case ends.
Extensions
-
1a. The given input is invalid.
-
1a1. ezFoodie shows an error message.
Use case ends.
-
-
2a. The member list is empty.
Use case ends.
Use case: UC06 - Show member profile
Actors: Staff
MSS
- Staff requests to list a set of members (UC03 or UC05).
- Staff requests to view a specific member in the member list by member ID.
-
ezFoodie shows the specific member’s details.
Use case ends.
Extensions
-
2a. The given input is invalid.
-
2a1. ezFoodie shows an error message.
Use case resumes at step 1.
-
-
2b. The given member ID does not exist in the member list.
-
2b1. ezFoodie shows an error message.
Use case resumes at step 1.
-
Use case: UC07 - Add transaction by member ID
Actors: Staff
MSS
- Staff requests to list a set of members (UC03 or UC05).
- Staff requests to add transaction details for a member by member ID.
-
The transaction of the member is added in ezFoodie.
Use case ends.
Extensions
-
2a. The given input is invalid.
-
2a1. ezFoodie shows an error message.
Use case resumes at step 1.
-
-
2b. The given member ID does not exist in the member list.
-
2b1. ezFoodie shows an error message.
Use case resumes at step 1.
-
Use case: UC08 - Redeem member’s points by [field]
Actors: Staff
MSS
- Staff requests to list a set of members (UC03 or UC05).
- Staff requests to redeem one gift (e.g. 1 item = 100 points) for a member by [field], [field] can be member ID or index number.
-
The points of the member are deducted (e.g. -100 points) in ezFoodie.
Use case ends.
Extensions
-
2a. The given input is invalid.
-
2a1. ezFoodie shows an error message.
Use case resumes at step 1.
-
-
2b. The given [field] does not exist in the member list.
-
2b1. ezFoodie shows an error message.
Use case resumes at step 1.
-
-
2c. The member does not have enough points.
-
2c1. ezFoodie shows an error message.
Use case resumes at step 1.
-
Use case: UC09 - Add reservation by member ID
Actors: Staff
MSS
- Staff requests to list a set of members (UC03 or UC05).
- Staff requests to add reservation for the member by member ID.
-
A reservation date time and remark of the member are added in ezFoodie.
Use case ends.
Extensions
-
2a. The given input is invalid.
-
2a1. ezFoodie shows an error message.
Use case resumes at step 1.
-
-
2b. The given member ID does not exist in the member list.
-
2b1. ezFoodie shows an error message.
Use case resumes at step 1.
-
-
2c. The reservation date time is not after the current date time.
-
2c1. ezFoodie shows an error message.
Use case resumes at step 1.
-
-
2d. Multiple reservations on the same day are added for the same member.
-
2d1. ezFoodie shows an error message.
Use case resumes at step 1.
-
Use case: UC10 - Clear the program
Actors: Manager
Preconditions
Manager is logged in
MSS
- Manager requests to clear and initialize the entire program.
-
All the data in ezFoodie is removed.
Use case ends.
Extensions
-
1a. The given input is invalid.
-
1a1. ezFoodie shows an error message.
Use case ends.
-
Use case: UC11 - Login as a manager
Actors: Manager
MSS
- Manager requests to login as a manager.
-
ezFoodie switch to Manager Mode.
Use case ends.
Extensions
-
1a. The given input is invalid.
-
1a1. ezFoodie shows an error message.
Use case ends.
-
-
1b. The password is not correct.
-
1b1. ezFoodie shows an error message.
Use case ends.
-
Use case: UC12 - Logout as a manager
Actors: Manager
Preconditions
Manager is logged in
MSS
- Manager requests to logout as a manager.
-
ezFoodie switch to Normal Mode.
Use case ends.
Extensions
-
1a. The given input is invalid.
-
1a1. ezFoodie shows an error message.
Use case ends.
-
Use case: UC13 - Update login password
Actors: Manager
Preconditions
Manager is logged in
MSS
- Manager requests to update the login password.
-
A new login password is updated in ezFoodie.
Use case ends.
Extensions
-
1a. The given input is invalid.
-
1a1. ezFoodie shows an error message.
Use case ends.
-
Use case: UC14 - Sort members by credit in [field]
Actors: Manager
Preconditions
Manager is logged in
MSS
- Manager requests to sort members by credit in [field], [field] can be ascending order or descending order.
-
ezFoodie shows a list of members sorted by credit in [field].
Use case ends.
Extensions
-
1a. The given input is invalid.
-
1a1. ezFoodie shows an error message.
Use case ends.
-
-
2a. The member list is empty.
Use case ends.
Use case: UC15 - Edit member [field1] by [field2]
Actors: Manager
Preconditions
Manager is logged in
MSS
- Manager requests to list a set of members (UC03 or UC05).
- Manager requests to edit member [field1] by [field2], [field1] can be name, phone, email or address, [field2] can be member ID or index number.
-
ezFoodie shows the updated information of the member.
Use case ends.
Extensions
-
2a. The given input is invalid.
-
2a1. ezFoodie shows an error message.
Use case resumes at step 1.
-
-
2b. The given [field2] does not exist in the member list.
-
2b1. ezFoodie shows an error message.
Use case resumes at step 1.
-
-
2c. The new phone or email already exists in the member list.
-
2c1. ezFoodie shows an error message.
Use case resumes at step 1.
-
Use case: UC16 - Delete member by [field]
Actors: Manager
Preconditions
Manager is logged in
MSS
- Manager requests to list a set of members (UC03 or UC05).
- Manager requests to delete the member by [field], [field] can be member ID or index number.
-
The member is deleted from ezFoodie.
Use case ends.
Extensions
-
2a. The given input is invalid.
-
2a1. ezFoodie shows an error message.
Use case resumes at step 1.
-
-
2b. The given [field] does not exist in the member list.
-
2b1. ezFoodie shows an error message.
Use case resumes at step 1.
-
Use case: UC17 - Edit reservation by member ID and reservation ID
Actors: Staff
MSS
- Staff requests to list a set of members (UC03 or UC05).
- Staff requests to edit reservation by member ID and reservation ID.
-
The reservation of the member is updated in ezFoodie.
Use case ends.
Extensions
-
2a. The given input is invalid.
-
2a1. ezFoodie shows an error message.
Use case resumes at step 1.
-
-
2b. The given member ID does not exist in the member list.
-
2b1. ezFoodie shows an error message.
Use case resumes at step 1.
-
-
2c. The given reservation ID does not exist in the member with the given member ID.
-
2c1. ezFoodie shows an error message.
Use case resumes at step 1.
-
-
2d. The reservation date time is not after the current date time.
-
2d1. ezFoodie shows an error message.
Use case resumes at step 1.
-
Use case: UC18 - Delete reservation by member ID and reservation ID
Actors: Manager
Preconditions
Manager is logged in
MSS
- Manager requests to list a set of members (UC03 or UC05).
- Manager requests to delete reservation by member ID and reservation ID.
-
The reservation of the member is deleted from ezFoodie.
Use case ends.
Extensions
-
2a. The given input is invalid.
-
2a1. ezFoodie shows an error message.
Use case resumes at step 1.
-
-
2b. The given member ID does not exist in the member list.
-
2b1. ezFoodie shows an error message.
Use case resumes at step 1.
-
-
2c. The given reservation ID does not exist in the member with the given member ID.
-
2c1. ezFoodie shows an error message.
Use case resumes at step 1.
-
Use case: UC19 - Retrieve previous commands
Actors: Staff
MSS
- Staff requests to retrieve previous commands by pressing the
upordownkey on the keyboard. -
The previous commands saved in the history (up to 30) will be shown in the command box one by one.
Use case ends.
Extensions
-
1a. 30 commands saved in the history, and
upkey is pressed more than 30 times continuously from the beginning.-
1a1. ezFoodie shows empty in the command box.
Use case resumes at step 1.
-
-
1b. 30 commands saved in the history, and
downkey is pressed more than 30 times continuously from the beginning.-
1b1. ezFoodie shows empty in the command box.
Use case resumes at step 1.
-
-
1c. No more than 30 commands saved in the history, and
upkey is pressed more than the number of stored commands history continuously from the beginning.-
1c1. ezFoodie shows empty in the command box.
Use case resumes at step 1.
-
-
1d. No more than 30 commands saved in the history, and
downkey is pressed more than the number of stored commands history continuously from the beginning.-
1d1. ezFoodie shows empty in the command box.
Use case resumes at step 1.
-
Use case: UC20 - Edit transaction by member ID and transaction ID
Actors: Staff
MSS
- Staff requests to list a set of members (UC03 or UC05).
- Staff requests to edit transaction by member ID and transaction ID.
-
The transaction of the member is updated in ezFoodie.
Use case ends.
Extensions
-
2a. The given input is invalid.
-
2a1. ezFoodie shows an error message.
Use case resumes at step 1.
-
-
2b. The given member ID does not exist in the member list.
-
2b1. ezFoodie shows an error message.
Use case resumes at step 1.
-
-
2c. The given transaction ID does not exist in the member with the given member ID.
-
2c1. ezFoodie shows an error message.
Use case resumes at step 1.
-
Use case: UC21 - Delete transaction by member ID and transaction ID
Actors: Manager
Preconditions
Manager is logged in
MSS
- Manager requests to list a set of members (UC03 or UC05).
- Manager requests to delete transaction by member ID and transaction ID.
-
The transaction of the member is deleted from ezFoodie.
Use case ends.
Extensions
-
2a. The given input is invalid.
-
2a1. ezFoodie shows an error message.
Use case resumes at step 1.
-
-
2b. The given member ID does not exist in the member list.
-
2b1. ezFoodie shows an error message.
Use case resumes at step 1.
-
-
2c. The given transaction ID does not exist in the member with the given member ID.
-
2c1. ezFoodie shows an error message.
Use case resumes at step 1.
-
Use case: UC22 - View summary for registrations and transactions
Actors: Manager
Preconditions
Manager is logged in
MSS
- Manager requests to view summary for member registrations and transactions details.
-
ezFoodie shows a list of statistics including total number of member registrations, total number and amount of transactions in past months.
Use case ends.
Extensions
-
1a. The given input is invalid.
-
1a1. ezFoodie shows an error message.
Use case ends.
-
{More to be added}
Non-Functional Requirements
- Should work on any mainstream OS as long as it has Java
11or above installed. - Should be able to hold up to 1000 members without a noticeable sluggishness in performance for typical usage.
- Should be able to hold up to 5000 transactions without a noticeable sluggishness in performance for typical usage.
- A user with above average typing speed for regular English text (i.e. not code, not system admin commands) should be able to accomplish most of the tasks faster using commands than using the mouse.
- The application should not exceed 50mb in size.
- The documentation should be easy to understand.
{More to be added}
Glossary
- Mainstream OS: Windows, Linux, Unix, OS-X
- CSV File: A comma-separated values file is a delimited text file that uses a comma to separate values. Each line of the file is a data record. Each record consists of one or more fields, separated by commas. And it can be opened using Microsoft Excel (Ref: https://en.wikipedia.org/wiki/Comma-separated_values)
- JSON file: A file that uses human-readable text to store and transmit data objects consisting of attribute–value pairs and arrays (or other serializable values) (Ref: https://en.wikipedia.org/wiki/JSON)
- Staff: All employees of the restaurant who will be using the product
- Manager: A special subset of staff with higher permission who can get special access to certain higher level features
- Normal Mode: The mode before the manager login, Normal Mode by default
- Manager Mode: The mode after the manager login
- Membership Tiers: Different membership tiers give members different benefits. Tiers include Bronze, Silver, Gold, and Platinum
- Member Details: Member ID, Name, Phone, Email, Address, Membership Tiers, Registration Date, Credits, Points, Transaction
- Credits: Represents total amount of money spent at the restaurant (S$1 = 1 credit), accumulated and cannot be decreased
- Points: Earned 1 points for S$1, can be used to redeem gifts and will be spent
- Transaction: A payment made by a customer at the restaurant
- Redemption: Points that a member has can be redeemed for free items, and the points will then be deducted from the member’s account
- Reservation: A tag contains specific date time and remark that represents when the member will come for a meal
Appendix 2: Instructions for manual testing
Given below are instructions to test the app manually.
Launch and shutdown
-
Initial launch
-
Download the jar file and copy into an empty folder
-
Double-click the jar file Expected: Shows the GUI with a set of sample contacts. The window size may not be optimum.
-
-
Saving window preferences
-
Resize the window to an optimum size. Move the window to a different location. Close the window.
-
Re-launch the app by double-clicking the jar file.
Expected: The most recent window size and location is retained.
-
Opening help window
-
Opening help window
- Test case:
help
Expected: a help window will be popped up to display a list of commands and their respective format, and also a link to the user guide.
- Test case:
Listing out all members
-
Listing out all members
-
Prerequisites: There are multiple members exist in ezFoodie.
-
Test case:
list -mem/
Expected: all members with their own member ID, index number, name, tier, phone, email, credit, point and coming reservation (if exists) will be shwon.
-
Adding new member
-
Adding a new member while all members are being shownn
-
Prerequisites: List all members using the
list -mem/command. Multiple members in the member list. -
Test case:
add -mem/ -n/John Doe -p/92345678 -e/johnd@example.com -a/311, Clementi Ave 2, #02-25
Expected: A new member with nameJohn Doe, phone92345678, emailjohnd@example.comand address311, Clementi Ave 2, #02-25is added to the member list. -
Test case:
add -mem/ -n/John Bob -p/92345678 -e/johnb@example.com -a/113, Clementi Ave 3, #03-36
Expected: No member is added because the phone92345678already exists in the member list. Status message shows thatThis member (phone or email) already exists in the ezFoodie.. -
Test case:
add -mem/ -n/John Doe -p/92345678 -e/johnd@example.com
Expected: No member is added because not all compulsory field is filled. Status message showsInvalid command format!. -
Other incorrect adding member commands to try:
add -mem/ -n/John Doe,...(where command is not in correct format)
Expected: Status message showsInvalid command format!.
-
Finding members by [field]
-
Finding members while all members are being shown
- Prerequisites:
- List all members using the
list -mem/command. Multiple members are in the member list. - The [field] can be member ID, name, phone, email or registration date.
- List all members using the
-
Test case:
find -mem/ -id/00001
Expected: Member with member ID00001will be displayed. -
Test case:
find -mem/ -id/00001 00002
Expected: Members with member ID00001and00002will be displayed. -
Test case:
find -mem/ -n/Alex
Expected: Members with nameAlexwill be displayed. -
Test case:
find -mem/ -p/87438807
Expected: Member with phone87438807will be displayed. - Prerequisites: member wih member ID
99999is not in the member list.- Test case:
find -mem/ -id/00001
Expected: No member will be displayed. Status message shows0 members listed!.
- Test case:
- Other incorrect adding member commands to try:
find -mem/,...(where command is not in correct format)
Expected: Status message showsInvalid command format!.
- Prerequisites:
Editing member [field] by member ID
-
Editing a member while all members are being shown
- Prerequisites:
- List all members using the
list -mem/command. Multiple members are in the member list. - The [field] can be name, phone or email.
- List all members using the
-
Test case:
edit -mem/ -id/00002 -p/91234567 -e/berniceyu123@example.com
Expected: The phone and email of the with member ID00002are updated to91234567andberniceyu123@example.com. - Prerequisites: member wih member ID
99999is not in the member list.- Test case:
edit -mem/ -id/99999 -p/92233445 -e/johndoe@example.com
Expected: No member is updated. Status message showsThe member ID provided is invalid..
- Test case:
-
Test case:
edit -mem/ -id/00002 -p/92233445 -p/82233445 -e/berniceyu456@example.com
Expected: The phone and email of the with member ID00002are updated to82233445andberniceyu456@example.com. - Prerequisites: member with phone
87438807is in the member list.- Test case:
edit -mem/ -id/00003 -p/87438807 -e/charlotte123@example.com
Expected: No member is updated. Status message showsThis member (phone or email) already exists in the ezFoodie..
- Test case:
- Other incorrect adding member commands to try:
edit -mem/ -id/00003,...(where command does not contain any fields for editing)
Expected: Status message showsAt least one field to edit must be provided..
- Prerequisites:
Showing member profile
-
Showing a member profile
- Prerequisites:
- Member wih member ID
00001is in the member list. - Member wih member ID
99999is not in the member list.
- Member wih member ID
-
Test case:
show -mem/ -id/00001
Expected: A summary window will be popped up to display the details of the member with member ID00001. -
Test case:
show -mem/ -id/99999
Expected: No member details will be shown. Status message showsThe member ID provided is invalid.. - Other incorrect delete commands to try:
show -mem/,...(where command is not in correct format)
Expected: Status message showsInvalid command format!.
- Prerequisites:
Logging in as a manager
-
Logging in as a manager
-
Prerequisites: Login password is
123456. -
Test case:
login 123456
Expected: Logged in successfully and the role shown on bottom right corner of the program will becomeMANAGER. -
Test case:
login 654321
Expected: Failed to login and the role shown on bottom right corner of the program is stillSTAFF.
-
Adding transaction by member ID
-
Adding transaction by member ID
- Prerequisites:
- Member wih member ID
00001is in the member list. -
Showing member profile with member ID
00001.
- Member wih member ID
-
Test case:
add -txn/ -b/23.00 -id/00001
Expected: A new transaction with billing23.00is added to the transaction list of the member with member ID00001, which is shown in the member profile. Details of the added transaction shown in the status message. -
Test case:
add -txn/ -b/99999999.00 -id/00001
Expected: No transaction will be added. Status message showsBillings should be non-negative numeric with 2 decimal places, and max amount is 9999.99.. - Other incorrect delete commands to try:
add -txn/ -b/123.00,...(where command is not in correct format)
Expected: Status message showsInvalid command format!.
- Prerequisites:
Adding reservation by member ID
-
Adding reservation by member ID
- Prerequisites:
- Member wih member ID
00001is in the member list. -
Showing member profile with member ID
00001. - Current date time should be before A
2021-12-01 13:00, can be changed to any future date time if A is reached. - Current date time should be after B
2020-12-01 13:00.
- Member wih member ID
-
Test case:
add -rs/ -dt/2021-12-01 13:00 -rm/2 people -id/00001
Expected: A new reservation with date time2021-12-01 13:00and remark2 peopleis added to the reservation list of the member with member ID00001, which is shown in the member profile. Details of the added reservation shown in the status message. -
Test case:
add -rs/ -dt/2020-12-01 13:00 -rm/2 people -id/00001
Expected: No reservation will be added. Status message showsThe given reservation date time should be after current date time.. -
Test case:
add -rs/ -dt/2021-12-01 14:00 -rm/2 people -id/00001, this date also need to be changed to be the same as A if A is changed
Expected: No reservation will be added. Status message showsOnly one reservation can be added within the same day.. - Other incorrect delete commands to try:
add -txn/ -b/123.00,...(where command is not in correct format)
Expected: Status message showsInvalid command format!.
- Prerequisites:
Sorting members by credit in [field]
-
Sorting members by credit in [field], [field] can be ascending order or descending order.
- Prerequisites:
- List all members using the
list -mem/command. Multiple members in the member list. - Logged in as a manager.
- List all members using the
-
Test case:
sort -mem/ -c/ -a/
Expected: the members are sorted by credit in ascending order. -
Test case:
sort -mem/ -c/ -d/
Expected: the members are sorted by credit in descending order. - Other incorrect delete commands to try:
sort -mem/,...(where command is not in correct format)
Expected: Status message showsInvalid command format!.
- Prerequisites:
Deleting transaction by member ID and transaction ID
-
Deleting transaction by member ID
- Prerequisites:
- Member wih member ID
00001is in the member list. - Multiple transactions are in the transaction list of the member with member ID
00001. -
Showing member profile with member ID
00001.
- Member wih member ID
-
Test case:
del -txn/ -id/00001000001
Expected: Transaction with transaction ID000001in the transaction list of the member with member ID00001is deleted. Details of the deleted transaction shown in the status message. - Prerequisites: member wih member ID
99999is not in the member list.- Test case:
del -txn/ -id/99999000001
Expected: No transaction will be deleted. Status message showsThe member ID provided is invalid..
- Test case:
- Prerequisites: transaction wih transaction ID
999999is not in the transaction list.- Test case:
del -txn/ -id/00001999999
Expected: No transaction will be deleted. Status message showsThe transaction ID provided is invalid..
- Test case:
- Prerequisites:
Deleting reservation by member ID and reservation ID
-
Deleting reservation by member ID
- Prerequisites:
- Member wih member ID
00001is in the member list. - Multiple reservations are in the reservation list of the member with member ID
00001. -
Showing member profile with member ID
00001.
- Member wih member ID
-
Test case:
del -rs/ -id/00001000001
Expected: Reservation with reservation ID000001in the reservation list of the member with member ID00001is deleted. Details of the deleted reservation shown in the status message. - Prerequisites: member wih member ID
99999is not in the member list.- Test case:
del -rs/ -id/99999000001
Expected: No reservation will be deleted. Status message showsThe member ID provided is invalid..
- Test case:
- Prerequisites: reservation wih reservation ID
999999is not in the reservation list.- Test case:
del -rs/ -id/00001999999
Expected: No reservation will be deleted. Status message showsThe reservation ID provided is invalid..
- Test case:
- Prerequisites:
Deleting member by member ID
-
Deleting a member while all members are being shown
- Prerequisites:
- List all members using the
list -mem/command. Multiple members in the member list. - Logged in as a manager
- List all members using the
-
Test case:
del -mem/ -id/00001
Expected: member with member ID00001is deleted from the member list. Details of the deleted contact shown in the status message. -
Test case:
del -mem/ -id/000001
Expected: No member is deleted. Status message showsMember IDs should only contain 5 digits and it should not be blank, and max ID is 99999. - Do not have member with member ID
99999- Test case:
del -mem/ -id/99999
Expected: No member is deleted. Status message showsThe member ID provided is invalid..
- Test case:
- Prerequisites:
Clearing the program
-
Clearing the program
- Test case:
clear
Expected: All data will be cleared.
- Test case:
Exiting the program
-
Exiting the program
- Test case:
exit
Expected: The window of the program will close.
- Test case:
Saving data
-
Saving data and restoring data when it is cleared by accident
- Prerequisites:
- List all members using the
list -mem/command. Multiple members in the member list. - Locate the ezfoodie JSON file at the default location:
[JAR file location]/data/ezFoodie.json. - Back up the ezfoodie JSON file.
- List all members using the
- Test case: Clear the program, Exit the program, replace the current
[JAR file location]/data/ezFoodie.jsonwith the backed up ezfoodie JSON file, then relaunch the program
Expected: All the backed up data is restored.
- Prerequisites:
Appendix 3: Effort
If the effort required to create Address Book is 10, we would place the effort level required to implement the current version of ezFoodie at 20.
Our team has put in a significant amount of effort to get ezFoodie to the current version. Below, we list out the summany of the enhancement and extension implemented by us.
Enhancement and Extension
-
Features enhancement
As Address Book has undergone complete testing and a large number of iterations, we follow its design and architecture which allows us to ensure the robustness and stability of the program with great confidence.
Although we reused the basic features (e.g.,
add,edit,delete, andlist), we still put much more effort to enhance these features according to the requirements of our program. For example, we can now doadd,editanddeleteoperations on mutliple data models, which areMember,TransactionandReservation. -
Features extension
We realized that the basic features in Address Book are not able to fully meet our usage scenarios, so we also put a lot of effort to extend other features that are more suitable for our program.
First we added
Account,TransactionandReservationmodel for role (manager and staff) management, transaction management and reservation management respectively.Then we added
login,logoutto support role switching,sort,showandsummaryto support the statistics of current members and transactions, etc.Lastly, we had to integrate all these new features with the existing code to become this powerful ezFoodie aaplication! 🤩
The implemention details and design considerations for these features could be found in Implementation section.
-
UI extension
The UI is designed based on Address Book. We follow the principle of its neat and simple design style to ensure the principle of ease-of-use.
In addition, Compared to Address Book, ezFoodie has much more powerful display capabilities, it can display more details through multiple windows, such as displays the member details by
show -mem/ -id/00001command, and displays the statistics of current members and transactions bysummarycommand.
Appendix 4: Limitations and Future improvements
We acknowledge the fact that our current product is not perfect, and it still has rooms for improvement. Below are some limitations and future improvements of our product.
Limitations
-
Automatic reminder feature is not implemented
The program only displays the most recent reservation of each member on the main view, but it does not support the functionality of reminding managers and staffs automatically when the members are comming. When there are a large number of users and a large number of reservations, the ability of managers and staffs to arrange seats and menus for upcoming members in a timely and efficient manner is an important manifestation of the service capabilities of the restaurant, so this feature has a potential positive impact on the growth of restaurant members.
-
Undo/redo features are not implemented
Having the undo/redo feature can better improve use efficiency and fault tolerance due to fast typing. It is very important and necessary optimization that the user can recover the data in time if the user accidentally performs the wrong operation.
-
Pagination feature is not implemented
As the number of members increases, displaying all members on one page by
list -mem/is very unuser-friendly. If the managers and staffs needs to scroll to view a large amount of information, it will go against the original intention of the project itself: to improve the efficiency of managing members through fast typing.
Future Improvements
-
Add a timer thread
A timer thread can be added in the background of the application to keep track of all the reservations of members. When an upcoming reservation is detected, a prompt dialog will be popped up or the relevant member reservation information will be displayed in the upper right corner of the application.
-
Implement by following the proposed undo/redo
-
Add a command shortcut [-pg/] for pagination
By default, only 20 records are displayed at a time, the user and a parameter [-pg/] is added to the paging function, so that users can turn pages by typing quickly.
Continue to implement the current limitations mentioned above to make the program more user-friendly.