Skip to content

Commit

Permalink
Merge branch 'master' into branch-find-bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ngchisern committed Oct 28, 2021
2 parents 18a8a48 + d2cc54e commit c8c77e2
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 11 deletions.
54 changes: 43 additions & 11 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,17 @@ Some example commands you can try:
* Extraneous parameters for commands that do not take in parameters (such as `help`, `list`, `exit` and `clear`) will be ignored.<br>
e.g. if the command specifies `help 123`, it will be interpreted as `help`.

* Date inputs should follow one of the formats below

Format | Example
--------|------------------
**dd mmmm yyyy** | `08 November 2001`
**dd mmm yyyy** | `08 Nov 2021`
**yyyy mm dd** | `2021 11 08`
**dd-mm-yyyy** | `08-11-2021`
**yyyy/mm/dd** | `2021/11/08`
**dd/mm/yyyy** | `08/11/2021`

</div>

## Person Commands
Expand Down Expand Up @@ -170,7 +181,7 @@ The new task will automatically be assigned the 'General' tag if the task tag pa
</div>

Examples:
* `addtask l/sew buttons onto blazer d/20th August 2021 t/SO1` adds the task to the application if there is an order with the id of SO1.
* `addtask l/sew buttons onto blazer d/20 August 2021 t/SO1` adds the task to the application if there is an order with the id of SO1.

### Deleting a task : `deletetask`

Expand Down Expand Up @@ -214,7 +225,7 @@ Format: `edittask INDEX [l/LABEL] [d/DATE] [t/TASKTAG]`
* Existing values will be updated to the input values.

Examples:
* `edittask 1 l/order cloth d/19th September 2021` edits the label and date of the 1st task to be `order cloth` and `19th September 2021` respectively.
* `edittask 1 l/order cloth d/19 September 2021` edits the label and date of the 1st task to be `order cloth` and `19th September 2021` respectively.
* `edittask 2 t/General` edits the tag of the 2nd task to be `General`

### Marking a task as done : `marktask`
Expand Down Expand Up @@ -257,8 +268,8 @@ Adds an order to the application.
Format: `addorder l/LABEL c/CUSTOMER a/AMOUNT d/DATE`

Examples:
* `addorder l/blue blouse c/Alice a/21.90 d/20th August 2021`
* `addorder l/school uniform c/John a/15.00 d/15th October 2021`
* `addorder l/blue blouse c/Alice a/21.90 d/20 August 2021`
* `addorder l/school uniform c/John a/15.00 d/15 October 2021`

### Deleting an order: `deleteorder`

Expand Down Expand Up @@ -292,11 +303,32 @@ List all the incomplete orders.

Format: `incompleteorders`

### Sorting orders by amount: `sortorders`
### Sorting orders: `sortorders`

Sorts all orders based on a chosen field and arrangement.

Format: `sortorders f/FIELD o/ORDERING`

* Your orders are sorted based on the `FIELD` chosen. You may choose between:
* The Date field, identified with a "d" or "date".
* The Amount field, identified with an "a" or "amount".
* By default, the orders are sorted in the sequence they are added. This is also used as a tiebreaker when two or more orders have an identical value for the `FIELD` chosen.
* The direction of the arrangement depends on the `ORDERING`, which is either:
* Ascending, identified with an "asc" or "ascending".
* Descending, identified with a "desc" or "descending".

Sorts all orders by their amount and lists them in descending order.
<div markdown="span" class="alert alert-primary">:information_source: **Note:**
Adding / Deleting an order reverts the list to the default ordering.</div>

Format: `sortorders`
<div markdown="span" class="alert alert-primary">:information_source: **Note:**
The order list will automatically be be sorted in ascending order if the ORDERING parameter is not supplied.
</div>

Examples:
* `sortorders f/date o/descending` sorts your orders in descending order of date (orders with later dates shown first).
* `sortorders f/d o/asc` sorts your orders in ascending order of date (orders with earlier dates shown first).
* `sortorders f/a o/ascending` sorts your orders in ascending order of amount (orders for smaller amounts shown first).
* `sortorders f/amount` sorts your orders in ascending order of amount (orders for smaller amounts shown first).

### Viewing total orders: `totalorders`

Expand Down Expand Up @@ -377,9 +409,9 @@ Action | Format, Examples
Action | Format, Examples
--------|------------------
**ListTasks** | `listtask`
**AddTask** | `addtask l/LABEL d/DATE` e.g. `addtask l/sew buttons onto blazer d/20th August 2021`
**AddTask** | `addtask l/LABEL d/DATE` e.g. `addtask l/sew buttons onto blazer d/20 August 2021`
**DeleteTask** | `deletetask INDEX` e.g. `deletetask 1`
**EditTask** | `edittask INDEX l/LABEL d/DATE` e.g. `edittask 1 l/order cloth d/19th September 2021`
**EditTask** | `edittask INDEX l/LABEL d/DATE` e.g. `edittask 1 l/order cloth d/19 September 2021`
**MarkDone** | `markdone INDEX` e.g. `markdone 2`
**CompletedTasks** | `completedtasks`
**IncompleteTasks** | `incompletetasks`
Expand All @@ -389,12 +421,12 @@ Action | Format, Examples
Action | Format, Examples
--------|------------------
**ListOrders** | `listorder`
**AddOrder** | `addorder l/LABEL c/CUSTOMER a/AMOUNT d/DATE` e.g. `addorder l/blue blouse c/Alice a/21.90 d/20th August 2021`
**AddOrder** | `addorder l/LABEL c/CUSTOMER a/AMOUNT d/DATE` e.g. `addorder l/blue blouse c/Alice a/21.90 d/20 August 2021`
**DeleteOrder** | `deleteorder INDEX` e.g. `deleteorder 1`
**MarkOrder** | `markorder INDEX` e.g. `markorder 2`
**CompletedOrders** | `completedorders`
**IncompleteOrders** | `incompleteorders`
**SortOrders** | `sortorders`
**SortOrders** | `sortorders f/FIELD o/ORDERING` e.g. `sortorders f/date o/descending`
**ViewTotalOrders** | `totalorders`

###General Commands
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public class FindOrderCommand extends Command {
+ "Parameters: KEYWORD [MORE_KEYWORDS]...\n"
+ "Example: " + COMMAND_WORD + " August John";


private final OrderContainsKeywordsPredicate predicate;

public FindOrderCommand(OrderContainsKeywordsPredicate predicate) {
Expand Down

0 comments on commit c8c77e2

Please sign in to comment.