Skip to content

Commit

Permalink
Merge branch 'master' into Bug-Fixes-1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
sun-ruiheng authored Apr 11, 2024
2 parents 2ce0295 + 16b798b commit 8cfc933
Show file tree
Hide file tree
Showing 14 changed files with 121 additions and 104 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[![CI Status](https://github.com/se-edu/addressbook-level3/workflows/Java%20CI/badge.svg)](https://github.com/se-edu/addressbook-level3/actions)
[![codecov](https://codecov.io/gh/AY2324S2-CS2103T-T17-4/tp/graph/badge.svg?token=LPV8FKMOGM)](https://codecov.io/gh/AY2324S2-CS2103T-T16-3/tp)
[![CI Status](https://github.com/AY2324S2-CS2103T-T16-3/tp/workflows/Java%20CI/badge.svg)](https://github.com/AY2324S2-CS2103T-T16-3/tp/actions)
[![codecov](https://codecov.io/gh/AY2324S2-CS2103T-T16-3/tp/graph/badge.svg?token=VEEBDKIOHF)](https://codecov.io/gh/AY2324S2-CS2103T-T16-3/tp)

![Ui](docs/images/Ui.png)

# Gourmet Grid
# GourmetGrid
<!-- * Table of Contents -->
- Introduction
- About
Expand Down Expand Up @@ -63,7 +63,7 @@ This user guide provides in-depth documentation on GourmetGrid installation proc

1. Download the latest `gourmetgrid.jar` from [here](https://github.com/AY2324S2-CS2103T-T16-3/tp/releases).

1. Copy the file to the folder you want to use as the _home folder_ for your AddressBook.
1. Copy the file to the folder you want to use as the _home folder_ for GourmetGrid.

1. Open a command terminal, `cd` into the folder you put the jar file in, and use the `java -jar gourmetgrid.jar` command to run the application.<br>

Expand All @@ -72,12 +72,12 @@ This user guide provides in-depth documentation on GourmetGrid installation proc

* `list` : Lists all contacts.

* `add n/John Doe p/98765432 e/johnd@example.com a/John street, block 123, #01-01` : Adds a contact named `John Doe` to the Address Book.
* `add n/James Lim p/98765432 e/jameslim@example.com a/West Street #01-01 c/The Big Butcher` : Adds a contact named `James Lim` to GourmetGrid.

* `delete 3` : Deletes the 3rd contact shown in the current list.

* `clear` : Deletes all contacts.

* `exit` : Exits the app.

Refer to the [User Guide](#features) for details of each command. If unsure, you can also key in the command without additional arguments to check the expected command format, which will be shown in the response prompt.
Refer to the [User Guide](https://ay2324s2-cs2103t-t16-3.github.io/tp/UserGuide.html) for details of each command. If unsure, you can also key in the command without additional arguments to check the expected command format, which will be shown in the response prompt.
89 changes: 66 additions & 23 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ The `addfav` feature allows users to add suppliers as favourites.

**Aspect: How a contact being set as favourite is represented:**

- **Alternative 1 (current choice):** A boolean field in the `Person` class is used to indicate whether a `Person` is a favourite
- **Alternative 1 (current choice):** A boolean field in the `Person` class is used to indicate whether a `Person` is a favourite
- Pros: Make use of the current `Person` class by adding a simple primitive boolean to store information about favourites.
- Cons: Not a uniform way of representing information in the `Person` class given that all other fields are their own defined classes.

Expand Down Expand Up @@ -230,7 +230,7 @@ Below is the sequence diagram for the `listfav` command process:

### Add order feature

The `addorder` feature allows users to add orders from a supplier.
The `addorder` feature allows users to add orders to a contact.

#### Design considerations:

Expand All @@ -250,7 +250,7 @@ Below is the sequence diagram for the `addorder` command process:

<puml src="diagrams/AddOrderSequenceDiagram.puml" alt="AddOrderSequenceDiagram" />

### ListOrder Feature
### List order Feature

The `listorder` feature allows users to list all orders associated with a person in the address book, sorted by date in ascending order first, then sorted by order they were added in if date is the same. This is particularly useful for users who wish to track the order history of suppliers efficiently.

Expand Down Expand Up @@ -278,14 +278,14 @@ Below is the sequence diagram for the `listorder` command process:
- **Sorting by Status:** Introduce functionality to sort orders by their status (e.g., pending, completed), providing users with more flexibility in viewing order information.
- **Filtering Options:** Implement filters to allow users to view orders within a specific date range or with particular characteristics, such as orders over a certain value.

### DeleteOrder Feature
### Delete order Feature

The `deleteorder` feature allows users to delete a specific order from a supplier's list of orders, ensuring accurate and up-to-date record-keeping.

#### Design Considerations

- **Aspect: How order deletion is managed within Person objects**:
-

- **Alternative 1 (current choice):** Directly manage orders within the Person class by removing them from the person's orders list.
- Pros: Utilizes the existing structure of the Person class, allowing for straightforward access and modification of a person's order list.
- Cons: Adds complexity to the Person class, which now handles both personal information and order management.
Expand Down Expand Up @@ -462,16 +462,16 @@ _{More to be added}_

### Use cases

(For all use cases below, the **System** is the `AddressBook` and the **Actor** is the `user`, unless specified otherwise)
(For all use cases below, the **System** is the `GourmetGrid` and the **Actor** is the `user`, unless specified otherwise)

**Use case: Delete a person**

**MSS**

1. User requests to list persons
2. AddressBook shows a list of persons
3. User requests to delete a specific person in the list
4. AddressBook deletes the person
1. User requests to list contacts
2. System shows a list of contacts
3. User requests to delete a specific contact in the list
4. System deletes the contact

Use case ends.

Expand All @@ -481,13 +481,34 @@ _{More to be added}_

Use case ends.

- 3a. The given index is invalid.
- 3a. System detects that the contact does not exist.

- 3a1. AddressBook shows an error message.
- 3a1. System shows an error message.

Use case resumes at step 2.
Use case ends.

_{More to be added}_
---

**Use case: Add an order**

**MSS**

1. User requests to add an order to a contact
2. System adds the order to the contact

Use case ends.

**Extensions**

- 1a. System detects an error in the user command.
- 1a1. System shows an error message.

Use case ends.

- 1b. System detects that the contact does not exist.
- 1b1. System shows an error message.

Use case ends.

### Non-Functional Requirements

Expand Down Expand Up @@ -552,7 +573,27 @@ testers are expected to do more _exploratory_ testing.
1. Other incorrect delete commands to try: `delete`, `delete x`, `...` (where x is larger than the list size)<br>
Expected: Similar to previous.

1. _{ more test cases …​ }_
### Adding an order

1. Adding an order to a person

1. Prerequisites: List all persons using the list command. There is only 1 contact in the address book.

2. Test case: `addorder 1 d/ 2025-01-01 r/ 100 chicken wings`<br>
Expected: The number of orders of the first contact increases by 1. Details of the contact, with the new order, are shown in the status bar. The date of the new order is 2025-01-01 and the remark is 100 chicken wings.

3. Test case: `addorder 0 d/ 2025-01-01 r/ 100 chicken wings`<br>
Expected: No new order is added. An error indicating invalid command format is shown in the status bar.

4. Test case: `addorder 5 d/ 2025-01-01 r/ 100 chicken wings`<br>
Expected: No new order is added. An error indicating invalid person index is shown in the status bar.

5. Test case: `addorder 1 d/ 2025-99-99 r/ 100 chicken wings`<br>
Expected: No new order is added. An error indicating invalid date format is shown in the status bar.

2. Viewing orders after adding order to a contact.

1. To view the orders of the first contact after adding an order, use the `listorder 1` command.

### Saving data

Expand All @@ -568,22 +609,24 @@ testers are expected to do more _exploratory_ testing.

Team size: 4

1. **UI improvements:** The current UI shows the orders of a contact in`StatusBarFooter` when `listorder`
1. **UI improvements:** The current UI shows the orders of a contact in`StatusBarFooter` when `listorder`
command is called. We plan to add an `OrderListPanel` beside the existing `PersonListPanel` to show the orders
of a contact instead. This will allow users to view the orders of a contact in a more user-friendly manner,
of a contact instead. This will allow users to view the orders of a contact in a more user-friendly manner,
without having the need to call `listorder` repeatedly for the same contact whenever a new command updates `StatusBarFooter`.
Furthermore, when a very long field is added, the UI text may be truncated. We plan to add a tooltip to show
Furthermore, when a very long field is added, the UI text may be truncated. We plan to add a tooltip to show
the full text when the mouse hovers over the truncated text.

2. **Make `addorder` message more specific:** The current `addorder` command does not show a preview of the
order added, making it inconvenient for users as they have to scroll all the way to end of `StatusBarFooter`
to view their newly added order. We plan to show a preview of the order added. For example:
2. **Make `addorder` message more specific:** The current `addorder` command does not show a preview of the
order added, making it inconvenient for users as they have to scroll all the way to end of `StatusBarFooter`
to view their newly added order. We plan to show a preview of the order added. For example:
`Added Order: [100 oranges (by: 2024-04-15)] from Alex Yeoh`.

3. **Raise error when an outdated order date is added:** The current date validation does not check if the
order date is outdated when `addorder` command is called. We plan to raise an error when an outdated order date
3. **Raise error when an outdated order date is added:** The current date validation does not check if the
order date is outdated when `addorder` command is called. We plan to raise an error when an outdated order date
is added. For example: `Order date cannot be in the past`.

4. **Support more flexible phone number formats:** The current phone number validation only accepts numerical inputs.
We plan to support more flexible formats, including country codes and special characters. For example:
`+65 1234 5678`, `+129-123-334-5678`.

5. **Improve Search Functionality**: The current implementation of the find command allows users to search for contacts based on their names, tags, or company names. However, it does not support searching by address, email, or phone number. We acknowledge that the ability to search by these fields can significantly enhance user experience by providing more flexibility and efficiency in locating contact information. The initial decision to exclude address, email, and phone number from the search criteria was based on a focus on the most commonly used identifiers for quick search and to maintain simplicity in the search interface. We also considered the privacy implications and the less frequent necessity of searching by personal information such as phone numbers or addresses. However, in order to enhance the utility of our contact management system, we are planning to introduce expanded search capabilities. This will include the ability to search for contacts by their phone numbers, email addresses, and physical addresses. This enhancement aims to provide a comprehensive search functionality that meets the needs of all users, making the tool more versatile and efficient for locating specific entries.
43 changes: 29 additions & 14 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ pageNav: 3
# GourmetGrid User Guide

<!-- * Table of Contents -->
GourmetGrid User Guide
- Introduction
- About
- Quick Start
Expand Down Expand Up @@ -74,15 +73,15 @@ This user guide provides in-depth documentation on GourmetGrid installation proc
1. Copy the file to the folder you want to use as the _home folder_ for GourmetGrid.

1. Open a command terminal, `cd` into the folder you put the jar file in, and use the `java -jar gourmetgrid.jar` command to run the application.<br>
A GUI similar to the below should appear in a few seconds. Note how the app contains some sample data.<br>
A GUI similar to the screenshot below should appear in a few seconds. Note how the app contains some sample data.<br>
![Ui](images/Ui.png)

1. Type the command in the command box and press Enter to execute it. e.g. typing **`help`** and pressing Enter will open the help window.<br>
Some example commands you can try:

* `list` : Lists all contacts.

* `add n/James Lim p/98765432 e/[email protected] a/West Street #01-01 c/The Big Butcher` :
* `add n/James Lim p/98765432 e/[email protected] a/West Street #01-01 c/The Big Butcher` :
Adds a contact named `James Lim` with the corresponding details to the contact list.

* `delete 3` : Deletes the 3rd contact shown in the current list.
Expand Down Expand Up @@ -194,7 +193,7 @@ Examples:
- `addfav i/` returns an error message as the 'INDICES' field cannot be empty
- `addfav` returns an error message as it must be accompanied by the 'INDICES' field
- `addfav 1 i/ 2, 5` returns an error message as there should not be prefixes before the 'INDICES' field
-

### Showing favourite contacts : `listfav`

Lists the contacts that are marked as favourites
Expand All @@ -216,8 +215,14 @@ Examples:
- Removes the contacts specified by index as favourites

Format: `removefav i/INDICES`

- Removes the contacts at the specified `INDICES` from favourites. The indices refer to comma-separated index numbers (i.e. index, index, index) shown in the displayed contact list. Each index **must be a positive integer** 1,2,3, ...

<box type="tip" seamless>

**Note:** Indices corresponding to non-favourite contacts are deemed as invalid indices for `removefav`
</box>

Examples:
- `removefav i/ 1` Removes the contact at index `1` from favourites
- `removefav i/ 1, 1, 1` Removes the contact at index `1` as favourite once
Expand All @@ -233,44 +238,50 @@ Examples:
Search feature supports substring search by name and/or tags and/or company **ONLY**. Finds all contacts whose names, tags or company matches the substring keyword provided.

Format: `find FIELD/KEYWORD [FIELD/KEYWORD]...`

- Where `FIELD` is either `n/` for name or `t/` for tag or `c/` for company.
- `KEYWORD` is the keyword to search for, here are some guidelines:
- Each `FIELD` is optional BUT at least one `FIELD` and `KEYWORD` pair must be provided.
- `KEYWORD` is the keyword to search for, here are some rules:
- Name and Company should contain alphanumeric characters, spaces, hyphens and/or apostrophes only.
- Tags should contain alphanumeric characters only.
- The search is case-insensitive.
- Teh search will find contacts containing the provided keyword as a substring within the specified field(s)
- Multiple Search Fields are treated as a **Logical AND (&&)**. Therefore, a contact must match all specified keywords across any mentioned fields to appear in the search results.


#### Search Guidelines

* 'KEYWORD' cannot be empty.
* e.g. `find n/` will **NOT** work as 'KEYWORD' cannot be empty.


* 'KEYWORD' and next 'FIELD' should be separated by a space.
* e.g. `find n/John t/friends` will find all instances of John that have the tag friends
* but `find n/Johnt/tfriends` will instead return an error since it assumes you are searching for 'Johnt/tfriends'
* and there should not be non-alphabetic characters in the 'KEYWORD' field.
* e.g. `find n/John t/friends` will find all instances of John that have the tag friends, but `find n/Johnt/tfriends` will instead return an error since it assumes you are searching for 'Johnt/tfriends' and there should not be non-alphabetic characters in the 'KEYWORD' field.


* Multiple Search 'FIELD's will be treated as a **Logical AND (&&)**.
* e.g. `find n/John n/Doe` will return all instances of John and Doe.
* e.g. `find n/John t/friends c/ Meat` will return all instances of John that are tagged as friends and have Meat in their company name. This means if there exists a contact with the name John that is tagged as friends but has a company Mat, it will not be returned.
* e.g. `find n/Ale n/le` can return contacts such as ["Alex Lew", "Alexis Lebrun", "Alec"]


* 'KEYWORD' should **NOT** be empty and there should be at least one 'FIELD' and 'KEYWORD' pair.
* e.g. `find n/ t/` and `find ` will **NOT** work.


* There should not be prefixes before the first 'FIELD' and 'KEYWORD' pair.
* e.g. `find testing123 n/John` will **NOT** work.


* The search is case-insensitive.
* e.g. `find n/hans` will match `Hans Niemann` and `Hans Zimmer`


* The order of the keywords does not matter.
* e.g. Results of `find n/Hans n/Bo` will match the results of`find n/Bo n/Hans`


* You can have multiple of the same 'FIELD's.
* e.g. `find n/J n/Do` will match names with `J` AND `Do`, like `John Doe` or `Dohnut Jibs`


Examples:
* `find n/Joh` returns `john`, `John Doe` and `Johnann Sebastian Bach`

Expand Down Expand Up @@ -301,14 +312,19 @@ Format: `addorder INDEX d/DATE r/REMARK`
**Note:** A contact can have any number of orders (including 0)
</box>

<box type="tip" seamless>

**Note**: You can add an order with the same remark and date to the same supplier multiple times. This is because we understand that you may want to quickly make duplicate orders when demand is high without the hassle of deleting your original order and adding back the updated version again.
</box>

Examples:
* `addorder 1 d/2020-01-01 r/100 chicken wings`
* `addorder 1 r/20 * 150g lettuce d/2020-12-31`
* `addorder 2 r/20 tomatoes, 40 apples (green) d/2020-12-31`

### Listing orders : `listorder`

Shows a list of all orders for a contact, sorted **first by date from the earliest to the latest and then by the order they were added if the dates are the same.
Shows a list of all orders for a contact, sorted **FIRST** by date from the earliest to the latest and then by the order they were added if the dates are the same.

Format: `listorder INDEX`

Expand Down Expand Up @@ -433,5 +449,4 @@ Furthermore, certain edits can cause GourmetGrid to behave in unexpected ways (e
| **Remove Favourite** | `removefav i/INDICES`<br> e.g., `removefav i/2` |
| **List** | `list` |
| **Help** | `help` |
| **Exit** | `exit` |

| **Exit** | `exit` |
2 changes: 1 addition & 1 deletion docs/_markbind/layouts/default.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<li><a href="{{baseUrl}}/UserGuide.html" class="nav-link">User Guide</a></li>
<li><a href="{{baseUrl}}/DeveloperGuide.html" class="nav-link">Developer Guide</a></li>
<li><a href="{{baseUrl}}/AboutUs.html" class="nav-link">About Us</a></li>
<li><a href="https://github.com/se-edu/addressbook-level3" target="_blank" class="nav-link"><md>:fab-github:</md></a>
<li><a href="https://github.com/AY2324S2-CS2103T-T16-3/tp" target="_blank" class="nav-link"><md>:fab-github:</md></a>
</li>
<li slot="right">
<form class="navbar-form">
Expand Down
Loading

0 comments on commit 8cfc933

Please sign in to comment.