-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CS2113T-T12-4] RestaurantBuddy #35
base: master
Are you sure you want to change the base?
Changes from 123 commits
9fcc12f
3856130
508fd89
2ecf37f
ffaeb2e
9a54eeb
b3a78bb
0ab60ef
85d386c
058e823
4236bc6
d89d208
d2490b6
f2b36eb
7e87353
8501843
c4c5f20
36e1c16
f4f2494
32aaa7a
a31cdb1
0bf8634
3b84a32
53a3e83
9650ce7
5b8616a
ea74dc4
b799a4a
1f0f59e
07f92ba
cef820d
f18c310
05dfb7f
6d5e3ab
2774d62
cf46b0d
de2ccad
68951f0
7c11b7e
2c2181f
0e7d8e3
ac453c6
3126520
b1b11e2
846196e
94d9df2
b5bf716
81b85e2
5a9a955
dc87281
d55ed03
6323af5
1f36bf5
b194cf8
afd0bf8
e3cc03c
49ea04f
741901b
9793240
61853a8
f08adcb
79e73de
f2fc79b
71b7a2a
ab68137
7907516
d9365a0
b8269ff
95f81dc
06182e2
fe4016c
a8d3108
ac4e118
fa1c227
0524188
7b7d7d6
147836e
3474206
24b7a76
2fa765e
81e8cdc
12d9edb
e7153fc
b508dd2
3729d19
a6af985
01d0cd0
4ce8dc2
7bcc3a4
1f39f55
2c8ef3f
5de4bb9
9af6d65
83b9943
2e16c92
79ae5d9
9fee4ba
7969215
d6bcd9a
226a331
7e2be75
6c8ca99
e962376
dc9af70
68a7e82
a436880
99e740c
98dab8a
6ce85de
8fc12c4
bdc5b33
b49e7fc
d58ce40
6cc21e3
8badfbe
d56f963
190d7fd
9b814e5
641a44c
b63f117
25c86e2
8f794e9
0f41693
9c1916f
ccbadbc
467ad00
fd6fa51
12ceacc
d3eb87e
a7e2ce1
ddfd838
0983c25
7758c55
58b9f12
0b9af21
ae9c74f
8597568
97fec27
1884419
d352837
6776f42
ec88fbd
5a05dad
a28d481
b1e80eb
4799f86
bb439b1
eab2ca1
d67ab16
6e56f23
fae434a
557ea04
62382c8
fdd4aae
4a40cde
4089e9e
ec2c326
cd417e9
4f0220e
dfc6f28
192584b
4c4f253
45bb661
646502c
a8a3ae6
bdf4f73
e0909f6
e73c6a7
1c3ed95
ee7fb33
dca69c9
e344e4f
3303a82
40976f3
b76d8fa
aaa0524
2dd5677
58b548a
548952f
985658c
9e1c9a3
0f7ac20
d1764a4
081a8ee
a61eddf
91de64c
caadb93
5ee1e1a
8837d0a
d8bd525
12dd2fa
7509c6b
53d5ec1
aec77c3
7f7525f
dde8e5c
f8e38e6
a894e02
eeef729
1744901
c39908d
617b147
5086ccf
e5a993c
6d1a664
83ae2b7
f596438
c045b85
c3e7839
efa896f
e80c7ee
e683d74
b7982cc
40c367d
7460668
3020e5e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,3 +44,7 @@ checkstyle { | |
run{ | ||
standardInput = System.in | ||
} | ||
|
||
run { | ||
enableAssertions = true | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,211 @@ | ||
# Developer Guide | ||
# Developer Guide Draft | ||
|
||
## Acknowledgements | ||
## Introduction | ||
Restaurant Buddy is a command-line-interface (CLI) application for **restaurant managers** to | ||
help **keep track of restaurant data** such as its employees, dishes and ingredients in storage. | ||
|
||
{list here sources of all reused/adapted ideas, code, documentation, and third-party libraries -- include links to the original source as well} | ||
## Purpose | ||
? | ||
## How to use | ||
? | ||
|
||
## Design & implementation | ||
## Contents | ||
* [Design](#design) | ||
* [Architecture](#architecture) | ||
* [Employee Component](#employee-component) | ||
* [Ingredient Component](#ingredient-component) | ||
* [Dish Component](#dish-component) | ||
* [Storage Component](#storage-component) | ||
* [Implementation](#implementation) | ||
* [Appendix](#appendix) | ||
* [Product Scope](#product-scope) | ||
* [User Stories](#user-stories) | ||
* [Non Functional Requirements](#non-functional-requirements) | ||
* [Glossary](#glossary) | ||
* [Instructions for Manual Testing](#instructions-for-manual-testing) | ||
|
||
{Describe the design and implementation of the product. Use UML diagrams and short code snippets where applicable.} | ||
## Design | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps you can add an architecture diagram to give a higher level overview of how each component interacts with each other. |
||
|
||
### Architecture | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
## Product scope | ||
### Target user profile | ||
The Main component has 2 classes, `MainParser` and `MainUI`. It is responsible for parsing user commands and | ||
displaying messages to interact with the user. | ||
|
||
{Describe the target user profile} | ||
The rest of the app consists of 4 components: | ||
|
||
### Value proposition | ||
1. Employee: Modify data related to employee classes | ||
|
||
{Describe the value proposition: what problem does it solve?} | ||
2. Ingredient: Modify data related to ingredient classes | ||
|
||
## User Stories | ||
3. Dish: Modify data related to dish classes | ||
|
||
|Version| As a ... | I want to ... | So that I can ...| | ||
|--------|----------|---------------|------------------| | ||
|v1.0|new user|see usage instructions|refer to them when I forget how to use the application| | ||
|v2.0|user|find a to-do item by name|locate a to-do without having to go through the entire list| | ||
4. Storage: Reads and writes data to and from the hard disk | ||
|
||
## Non-Functional Requirements | ||
### Employee Component | ||
The employee component consists of the following four classes: `Employee`, `EmployeeList`, `EmployeeParser` | ||
and `EmployeeUI`. | ||
|
||
{Give non-functional requirements} | ||
* `Employee` stores the name and phone number of an individual employee working at the restaurant, as well as methods | ||
to retrieve employee information. | ||
|
||
## Glossary | ||
* `EmployeeList` is an array list of Employees. | ||
|
||
* *glossary item* - Definition | ||
* `EmployeeParser` contains operations that decode user inputs into meaningful commands, and modifies the list of | ||
employees accordingly. | ||
|
||
## Instructions for manual testing | ||
* `EmployeeUI` contains methods that display messages that interacts with the user. | ||
|
||
### Ingredient Component | ||
The ingredient component consists of the `Ingredient`, `IngredientList`, `IngredientParser`, and `IngredientUI` classes. | ||
|
||
* `Ingredient` stores the name and quantity of a particular ingredient used by the restaurant, as well as methods to | ||
retrieve ingredient data. | ||
|
||
* `IngredientList` is an array list of Ingredient. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
* `IngredientParser` contains operations that decode user inputs into meaningful commands, and modifies the list of | ||
ingredients accordingly. | ||
|
||
* `IngredientUI` contains methods that display messages to interact with the user. | ||
|
||
### Dish Component | ||
The dish component consists of the `Dish`, `Menu`, `DishParser`, and `DishUI` classes. | ||
|
||
* `Dish` stores the name, price and discount of a certain dish sold by the restaurant and the methods used to retrieve | ||
them. | ||
|
||
* `Menu` is an arrayList of Dish. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as the IngredientList, I think you can explain it better :) |
||
|
||
* `DishParser` contains methods that decode user inputs into meaningful parameters and modify the menu accordingly. | ||
|
||
* `DishUI` contains methods that display messages to interact with the user. | ||
|
||
### Storage Component | ||
The storage component has a `Storage` class which can load data from the file and save data into the file with the | ||
methods to encode and decode data. | ||
|
||
## Implementation | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For the implementation part, I feel that a step by step guide should be done. Common features like the Remove Dish Feature and Remove Ingredient Feature can be explained as 1 entity. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But other than that, I like how all the features are summarized:) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
### Add Employee Feature | ||
The mechanism of adding an employee into the list of employees is facilitated by `EmployeeParser`. It first creates a | ||
new instance of `Employee`, and adds it to the existing instance of `EmployeeList`. A confirmation message is then | ||
displayed to the user. | ||
|
||
### List Employees Feature | ||
The mechanism for listing all current employees in the list of employees is facilitated by `EmployeeParser`. It checks | ||
if the current instance of `EmployeeList` is empty, and if it is, displays a message to inform the user that the | ||
employee list is empty. Otherwise, it displays all employees and their information in the list to the user. | ||
|
||
### Remove Employee Feature | ||
The mechanism of removing an employee from the employee list is facilitated by `EmployeeParser`. It identifies the | ||
index of the employee to be removed from the current instance of `EmployeeList`, and removes that instance of | ||
`Employee` from the list. It then displays a message to the user to inform them of the successful deletion. | ||
|
||
### Add Ingredient Feature | ||
The mechanism of adding an ingredient into the ingredient list is facilitated by `IngredientParser`. It creates a new | ||
instance of `Ingredient`, and adds it to the existing instance of `IngredientList`. It then calls a method from | ||
`IngredientUI` to display a confirmation message to the user. | ||
|
||
### List Ingredients Feature | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps you can add class and sequence diagrams to each features |
||
The mechanism for listing all existing ingredients in the ingredient list is facilitated by `IngredientParser`. It | ||
checks if the existing instance of `IngredientList` is empty or not, and calls a method from `IngredientUI` to | ||
display the entire list of ingredients and their quantities to the user. | ||
|
||
### Remove Ingredient Feature | ||
The mechanism of removing an ingredient from the ingredient list is facilitated by `IngredientParser`. It identifies | ||
the index of the ingredient to be removed from the existing instance of `IngredientList` and removes that instance of | ||
`Ingredient` from the list. It then calls a method from `IngredientUI` which displays to the user that the deletion was | ||
successful. | ||
|
||
### Find Expired Ingredients Feature | ||
The mechanism of finding expired ingredients is facilitated by `IngredientParser` as well as the Java `LocalDate` | ||
class. `IngredientParser` converts the input String into a `LocalDate` object and calls a method from `IngredientUI`. | ||
This method loops through the current `IngredientList` and finds all instances of `Ingredient` with an expiry date | ||
before the input `LocalDate` object. It then displays to the user the list of ingredients that are expired, or informs | ||
Comment on lines
+207
to
+209
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should the UI be responsible for finding the expired ingredients? |
||
the user that no ingredients are expired. | ||
|
||
### Add Dish Feature | ||
The mechanism of adding a dish into the menu is facilitated by `DishParser`. It creates a new instance of | ||
`Dish`, and adds it to the existing instance of `Menu`. It then calls a method from `DishUI` to display a confirmation | ||
message to the user. | ||
|
||
### List Menu Feature | ||
The mechanism for listing all existing dishes in the menu is facilitated by `DishParser`. It checks if the | ||
existing instance of `Menu` is empty or not, and calls a method from `DishUI` to display the entire menu, | ||
together with the corresponding prices of each dish, to the user. | ||
|
||
### Remove Dish Feature | ||
The mechanism of removing a dish from the menu is facilitated by `DishParser`. It identifies the index of the | ||
dish to be removed from the existing instance of `Menu` and removes that instance of the dish from the menu. | ||
It then calls a method from `DishUI` which displays to the user that the deletion was successful. | ||
|
||
### Save Storage Feature | ||
The mechanism of saving all the data is facilitated by `Storage`. After executing the bye command, the | ||
program goes into saving data stage automatically. It opens the storage file with a file writer, and for every list the | ||
program has, it gets the item from them. Then, it encodes the string representation of the item, and writes it into the | ||
file. | ||
|
||
The three lists are stored in sequence as shown below, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just a note here, it's not completed here. Don't forget about this part:) |
||
|
||
### Load Storage Feature | ||
The mechanism of loading all the data from the storage file is facilitated by `Storage`. It opens the file with a file | ||
reader and if there are no files to open, it will automatically create a new file of default address. Every line read | ||
from the file would be decoded with methods to create a new `Employee`/`Dish`/`Ingredient` item, and add it into the | ||
list which is generated. | ||
|
||
The three types of new item are identified before decoding it, and the decoding methods are worked on at the | ||
same time. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps the part "the decoding methods are worked on at the same time" can be further elaborated with a diagram. |
||
|
||
## Appendix | ||
|
||
### Product Scope | ||
|
||
**Target user profile:** | ||
* needs to manage a significant amount of different types of restaurant data | ||
* prefers using a desktop application | ||
* is able to type quickly | ||
* prefers typing as compared to mouse interactions | ||
* is reasonably comfortable using CLI apps | ||
|
||
**Value proposition:** manage restaurant data faster than a typical mouse/_graphical user interface (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 ...** | | ||
| ------------ | ------------- | ------------- | ------------- | | ||
| `* * *` | restaurant manager | view all my current employees | keep track of them | | ||
| `* * *` | restaurant manager | add new employees | keep track of newly hired employees | | ||
| `* * *` | restaurant manager | delete employees | remove entries I no longer need | | ||
| `* * *` | restaurant manager | keep track of the ingredients I have left | know when to order more | | ||
| `* * *` | restaurant manager | add new ingredients | adjust to changes in my menu | | ||
| `* * *` | restaurant manager | delete ingredients | remove entries I no longer need | | ||
| `* * *` | restaurant manager | view my menu | keep track of it | | ||
| `* * *` | restaurant manager | add new dishes into my menu | increase the variety of my menu | | ||
| `* * *` | restaurant manager | remove dishes from my menu | focus more on my other dishes | | ||
| `* *` | restaurant manager | view all my employees' salaries | better manage my finances | | ||
| `* *` | restaurant manager | increase my employees' salaries | give them a raise when they are performing well | | ||
| `* *` | restaurant manager | decrease my employees' salaries | reduce my expenses when the cash flow is tight | | ||
| `* *` | restaurant manager | keep track of my employees' offs | plan my manpower effectively | | ||
| `* *` | restaurant manager | change the price of a dish | adjust it according to other external factors | | ||
| `* *` | restaurant manager | add a discount to a dish | organise promotions to attract more customers | | ||
| `* *` | restaurant manager | add daily earnings and expenditure | keep track of my finances | | ||
| `*` | restaurant manager | check for loss of utensils | account for them and order more accordingly | | ||
| `*` | restaurant manager | check the prices for advertisements | evaluate the benefits they bring | | ||
| `*` | restaurant manager | view customer complaints | improve my restaurant based on their feedback | | ||
| `*` | restaurant manager | keep track of popular dishes | plan the menu in the way that maximises my revenue | | ||
|
||
### Non Functional Requirements | ||
1. You need to have a _mainstream operating system (OS)_ with Java `11` or above installed. | ||
2. For normal usage without noticeable lag, total data entries stored should be less than 1000. | ||
3. To be faster than a typical mouse/GUI driven application, you need to have an above average typing speed for regular | ||
English text (i.e. not code, not system admin commands). | ||
|
||
### Glossary | ||
* **Mainstream OS:** Windows, Linux, Unix, macOS | ||
* **GUI:** A type of user interface that allows users to interact with applications through graphical icons. | ||
|
||
### Instructions for Manual Testing | ||
|
||
{Give instructions on how to do a manual product testing e.g., how to load sample data to be used for testing} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are subcomponents inside the implementation parts. Maybe its better to add this in like how you did for the Design Components.