Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
9hafidz6 authored Oct 16, 2019
2 parents 61a3f68 + 22da31b commit 55069fa
Showing 21 changed files with 290 additions and 55 deletions.
2 changes: 2 additions & 0 deletions data/tasks.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
T|1|read book
D|1|return book|09/09/09 2359
E|0|meeting|here
T|0|test 09/09/09
T|0|test1 16/10/2019
18 changes: 14 additions & 4 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
@@ -44,7 +44,7 @@

#### 2.1 Architecture

![architecture](https://github.com/9hafidz6/main/blob/master/docs/images/architecture.png)
![architecture](https://github.com/9hafidz6/main/blob/master/docs/images/architectureV1.1.png)

`main` has 1 class called `Duke`. It is responsible for,

@@ -61,6 +61,8 @@ The Application consist of 6 other components
- `task`: stores a list of deadline/event/todo that needs to be done
- `ui`: The UI of the application

![sequence](https://github.com/9hafidz6/main/blob/master/docs/images/UMLsequence.png)

#### 2.2 UI


@@ -152,8 +154,7 @@ Target user profile: Restaurant Chef

| Priority | As a ... | I want to ... | So that ... |
| -------- | ------------------ | ------------------------------------------------------------ | ---------------------------------------------------- |
| Epic | restaurant manager | I want to be able to prepare the salary reports | my employees could get the right salary |
| High | restaurant manager | I want to ensure that data related to my restaurant is secure | not anyone can have access |
| High | restaurant manager | I want to ensure that only specific users are able to access the application | the data related to my restaurant is secure |
| High | restaurant manager | I want to keep track of food expiry dates | the restaurant will not serve expired food |
| High | restaurant manager | I want to note down my part timer's available dates | I can ensure there is enough manpower in the kitchen |
| Medium | restaurant manager | I want to keep track of my monthly expenses | I know whether I am making a profit or loss |
@@ -166,6 +167,8 @@ Target user profile: Restaurant Chef

**Use case: Exit the program**

**MSS**

​ 1. User requests to exit the program

​ 2. Program exits
@@ -304,11 +307,18 @@ Target user profile: Restaurant Chef

### Appendix D: Non Functional Requirement

1. should work on any windows OS as long it has `java 11` or newer installed
2. The application needs to be secure. only specific users are able to access this application. for example, the restaurant manager as well as the chef
3. should be reliable in displaying accurate and correct data
4. should be easy to use for users with basic knowledge of command line interface
5. should be able to handle large amounts of data without displaying any slowdown in application performance
6.


### Appendix E: Glossary

### Appendix E: Glossary

1.

### Appendix F: Product Survey

118 changes: 85 additions & 33 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
@@ -3,21 +3,25 @@
1. Introduction
2. Quick Start
3. Features
- bye: Exit the program. [Level-1]
- list: Show all the tasks. [Level-2]
- done: Mark a task as done. [Level-3]
- todo: Create a new todo task. [Level-4]
- deadline: Create a new deadline task. [Level-4]
- event: Create a new event task. [Level-4]
- Load and save tasks to hard disk. [Level-7]
- Identify dates and times. [Level-8]
- delete: Delete a task. [Level-6]
- find: Find a task by searching for a keyword. [Level-9]
- bye: Exit the program
- list: Show all the tasks
- done: Mark a task as done
- todo: Create a new todo task
- deadline: Create a new deadline task
- event: Create a new event task
- Load and save tasks to hard disk
- Identify dates and times
- delete: Delete a task
- find: Find a task by searching for a keyword.
- Error Handling
4. Command Summary
5. FAQ

## 1. Introduction

Duke is targeted towards restaurant chefs who wants to be able to consolidate most of the things happening in their kitchen such as recipes, ingredients, expiry dates etc. By using this product, you are able to order all the ingredients needed for your kitchen. Additionally, you can try out new recipes and save it in Duke. you can also view customer feedback.
Duke is targeted towards restaurant chefs who wants to be able to consolidate most of the things happening in their kitchen such as recipes, ingredients, expiry dates etc. By using this product, you are able to order all the ingredients needed for your kitchen. Additionally, this application takes in customers order/preorder of the restaurants dishes. The customers are able to give their feedback/rating of the dishes. the average rating of all the dishes can be viewed by the restaurant chef. Proceed to the Developer Guide [here]( https://github.com/AY1920S1-CS2113-T14-2/main/blob/master/docs/DeveloperGuide.md ) to learn more about this application.



## 2. Quick Start

@@ -39,7 +43,7 @@ Duke is targeted towards restaurant chefs who wants to be able to consolidate mo
2. **deadline** prepare new recipe **/by** 1/1/2019: adds a deadline task "prepare new recipe" into your list by "1/1/2019"
3. **bye**: exits the program

7. Refer to Section 4 for the full list of features
7. Refer to Section 4 for the full list of commands

## 3. Features

@@ -48,13 +52,13 @@ Duke is targeted towards restaurant chefs who wants to be able to consolidate mo
- commands are in `UPPER_CASE` are to be provided by the user eg. `todo d/DESC`, `DESC` is a parameter which can be used as `todo d/buy groceries`
-

### 3.1 bye: Exit the program. [Level-1]
### 3.1 bye: Exits the program

outputs an exit message to the user and terminates the program

Format: `bye`

### 3.2 list: Show all the tasks. [Level-2]
### 3.2 list: Show all the tasks

Shows all the task marked done/undone to the user

@@ -66,86 +70,134 @@ shows the user all the tasks that is stored in Duke
1.[D][✓] return book(by: Monday)
2.[E][✘] meeting(at: U-Town)
3.[P][✓] lecture(from: 1600 to: 1800)
### 3.3 done: Mark a task as done. [Level-3]
### 3.3 done: Mark a task as done

marks a task in list as done.

Format: `done` <indx>

eg. `done 1`, outputs: [ T ] [] return book
eg. `done 1`

Nice! I've marked this task as done:
[D][✓] return book(by: Monday)
### 3.4 todo: Create a new todo task. [Level-4]
### 3.4 todo: Create a new todo task

creates a new task, todo where user enters the description of the task that needs to be done

Format: `todo` <desc>

eg. `todo order eggs`, stores T|0|order eggs, outputs [ T ] [] order eggs
eg. `todo order eggs`

Got it. I've added this task:
[T][✘] order eggs
Now you have 6 tasks in the list.
### 3.5 deadline: Create a new deadline task. [Level-4]
### 3.5 deadline: Create a new deadline task

creates a new task, deadline, where user enters their tasks as well the date that the task needs to be done

Format: `deadline` <desc> `/by` <desc>

eg. `deadline submit review /by 1/1/2019`, stores D|0|submit review|1/1/2019 , outputs [ D ] [] submit review (/by: 1/1/2019)
eg. `deadline submit review /by 1/1/2019`, stores D|0|submit review|1/1/2019

output:

Got it. I've added this task:
[D][✘ ] submit review(by: 1/1/2019)
Now you have 5 tasks in the list.
### 3.6 event: Create a new event task. [Level-4]
### 3.6 event: Create a new event task

creates a new task, event, where user enters their tasks as well the date that the task needs to be done

Format: `event`<desc> `/at` <desc>

eg. `event birthday /at multi purpose hall`, stores E|0|submit review|multi purpose hall , outputs [ED ] [] birthday (/at: multi purpose hall)
eg. `event birthday /at multi purpose hall`, stores E|0|submit review|multi purpose hall

output:

Got it. I've added this task:
[E][✘] birthday(at: multi purpose hall)
Now you have 4 tasks in the list.


### 3.10 delete: Delete a task. [Level-6]
### 3.10 delete: Delete a task

deletes a tasks that was stored in Duke regardless of it being marked as done or undone.

Format: `delete` <indx>

eg. `delete 1`, deletes the first task that is stored in Duke, if task does not exist, output an error message to user `Enter a valid task number after done, between 1 and x` (x is the total number of tasks in Duke)
eg. `delete 1`, deletes the first task that is stored in Duke

output:

Noted. I've removed this task:
[T][✓] read book
Now you have 3 tasks in the list.
### 3.12 find: Find a task by searching for a keyword. [Level-9]
### 3.12 find: Find a task by searching for a keyword

finds a task in Duke which contains a specific word or description

Format: `find` <desc>

eg. `find eggs`, iterates through all the task in Duke and if any of the tasks contains the description, output the task to the user
eg. `find eggs`, iterates through all the task in Duke and if any of the tasks contains the description,

output:

Here are the matching tasks in your list:
1.[T][✘] stock up on eggs
2.[D][✘] buy eggs(by: Monday)
3.[T][✘] create a new egg sandwich
if there are no matches, outputs `No matching tasks found!`
### 3.13 Error Handling

handles unexpected commands from the user such as unknown/incomplete command. if user enters an invalid command, the application will output a message that corresponds to what the user entered wrongly.

eg. `deadline` <empty desc>, `deadline` <desc> `by` <empty desc>, `delete` <empty indx>

outputs:

```
____________________________________________________________
☹ OOPS!!! The description cannot be empty.
____________________________________________________________
```

### 3.14 stats: gives the statistics of the Dish

### 3.15 order: creates a new order

### 3.16 preorder:

### 3.17 help: shows a list of commands to the user

things to include in version 2:

...

## 4. Command Summary

Index | Keyword | Usage
----- | -------- | ----------
1 | bye | bye
2 | list | list
3 | done | done \<indx\>
4 | todo | todo \<desc\>
5 | deadline | deadline \<desc\> /by \<date\>
6 | event | event \<desc\> /at \<date\>
7 | delete | delete \<indx\>
8 | find | find \<desc\>
3 | done | done <indx>
4 | todo | todo <desc>
5 | deadline | deadline <desc> /by <date>
6 | event | event <desc> /at <date>
7 | delete | delete <desc>
8 | find | find <desc>
9 | remind | remind
10 | stats | stats
11 | order | order <desc> <index>
12 | preorder | preorder <desc> <indx>
13 | cancel | cancel <indx>
14 | help | help

# 5. FAQ

Q: how do I transfer data to another computer

A: install the application on the other computer and an empty recipe.txt will be created under the data folder. Replace this file with the same file found in your previous computer. therefore your data will be transferred

Q:

A:
Binary file added docs/images/UMLsequence.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/architectureV1.1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion src/main/java/duke/Duke.java
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@
import duke.command.Command;
import duke.exception.DukeException;
import duke.parser.Parser;
import duke.recipebook.dishlist;
import duke.storage.Storage;
import duke.task.TaskList;
import duke.ui.Ui;
@@ -15,12 +16,14 @@ public class Duke {
private Storage storage;
private TaskList tasks;
private Ui ui;
private dishlist dish;

/**
* The constructor method for Duke.
* @param filePath used to specify the location of the file in the hard disc.
*/
public Duke(String filePath) {
dish = new dishlist();
ui = new Ui();
storage = new Storage(filePath);
try {
@@ -42,7 +45,7 @@ public void run() {
String fullCommand = ui.readCommand();
ui.showLine();
Command c = Parser.parse(fullCommand, tasks.size());
c.execute(tasks, ui, storage);
c.execute(dish, tasks, ui, storage);
isExit = c.isExit();
} catch (DukeException e) {
ui.showError(e.getMessage());
23 changes: 16 additions & 7 deletions src/main/java/duke/command/AddCommand.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package duke.command;

import duke.exception.DukeException;
import duke.recipebook.dishes;
import duke.recipebook.dishlist;
import duke.storage.Storage;
import duke.task.Task;
import duke.task.TaskList;
@@ -14,6 +16,7 @@
public class AddCommand extends Command {

private Task task;
private dishes dish;

/**
* The constructor method for AddCommand.
@@ -24,6 +27,10 @@ public AddCommand(Task task) {
this.task = task;
}

public AddCommand(dishes dish) {
this.dish = dish;
}

/**
* Public method used to add the task in the taskList, and write it on the hard disc.
*
@@ -33,13 +40,15 @@ public AddCommand(Task task) {
* @throws DukeException Error while adding the command to the duke.txt file
*/
@Override
public void execute(TaskList taskList, Ui ui, Storage storage) throws DukeException {
public void execute(dishlist dish1, TaskList taskList, Ui ui, Storage storage) throws DukeException {
taskList.addTask(task);
ui.showAddCommand(task.toString(), taskList.size());
try {
storage.addCommandInFile(task.printInFile());
} catch (IOException e) {
throw new DukeException("Error while adding the command to the duke.txt file");
}
dish1.addDish(dish); // add dish into list found in dishes class
System.out.println("\t dish added: " + dish.toString() + "\n\t amount :" + dish.getAmount());
// ui.showAddCommand(task.toString(), taskList.size());
// try {
// storage.addCommandInFile(task.printInFile());
// } catch (IOException e) {
// throw new DukeException("Error while adding the command to the duke.txt file");
// }
}
}
3 changes: 2 additions & 1 deletion src/main/java/duke/command/Command.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package duke.command;

import duke.exception.DukeException;
import duke.recipebook.dishlist;
import duke.storage.Storage;
import duke.task.TaskList;
import duke.ui.Ui;
@@ -10,7 +11,7 @@
*/
public abstract class Command {

public abstract void execute(TaskList taskList, Ui ui, Storage storage) throws DukeException;
public abstract void execute(dishlist dish1, TaskList taskList, Ui ui, Storage storage) throws DukeException;

/**
* Returns the boolean indicating that it is( not) an {@link ExitCommand}.
3 changes: 2 additions & 1 deletion src/main/java/duke/command/DeleteCommand.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package duke.command;

import duke.exception.DukeException;
import duke.recipebook.dishlist;
import duke.storage.Storage;
import duke.task.Task;
import duke.task.TaskList;
@@ -23,7 +24,7 @@ public DeleteCommand(int taskNb) {
}

@Override
public void execute(TaskList taskList, Ui ui, Storage storage) throws DukeException {
public void execute(dishlist dish1, TaskList taskList, Ui ui, Storage storage) throws DukeException {
if (taskNb < taskList.size() && taskNb >= 0) {
Task removed = taskList.removeTask(taskNb);
List<String> fileContent = null;
Loading

0 comments on commit 55069fa

Please sign in to comment.