diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml
index aabbbdbaf33..48ac24d7fed 100644
--- a/.github/workflows/gradle.yml
+++ b/.github/workflows/gradle.yml
@@ -35,7 +35,16 @@ jobs:
java-version: '11'
java-package: jdk+fx
- - name: Build and check with Gradle
+ - name: Setup xvfb for headless UI testing
+ if: runner.os == 'Linux'
+ run: sudo apt-get install -y xvfb
+
+ - name: Build and check with Gradle (Linux)
+ if: runner.os == 'Linux'
+ run: xvfb-run ./gradlew check coverage
+
+ - name: Build and check with Gradle (other OS)
+ if: ${{ runner.os != 'Linux' }}
run: ./gradlew check coverage
- uses: codecov/codecov-action@v2
diff --git a/README.md b/README.md
index 13f5c77403f..d8c52a03229 100644
--- a/README.md
+++ b/README.md
@@ -1,14 +1,20 @@
-[![CI Status](https://github.com/se-edu/addressbook-level3/workflows/Java%20CI/badge.svg)](https://github.com/se-edu/addressbook-level3/actions)
+# PetCode
+[![CI Status](https://github.com/AY2223S1-CS2103T-T09-2/tp/workflows/Java%20CI/badge.svg)](https://github.com/AY2223S1-CS2103T-T09-2/tp/actions)
+[![codecov](https://codecov.io/gh/AY2223S1-CS2103T-T09-2/tp/branch/master/graph/badge.svg?token=F6VVPXKC9C)](https://codecov.io/gh/AY2223S1-CS2103T-T09-2/tp)
![Ui](docs/images/Ui.png)
-* This is **a sample project for Software Engineering (SE) students**.
- Example usages:
- * as a starting point of a course project (as opposed to writing everything from scratch)
- * as a case study
-* The project simulates an ongoing software project for a desktop application (called _AddressBook_) used for managing contact details.
- * It is **written in OOP fashion**. It provides a **reasonably well-written** code base **bigger** (around 6 KLoC) than what students usually write in beginner-level SE modules, without being overwhelmingly big.
- * It comes with a **reasonable level of user and developer documentation**.
-* It is named `AddressBook Level 3` (`AB3` for short) because it was initially created as a part of a series of `AddressBook` projects (`Level 1`, `Level 2`, `Level 3` ...).
-* For the detailed documentation of this project, see the **[Address Book Product Website](https://se-education.org/addressbook-level3)**.
-* This project is a **part of the se-education.org** initiative. If you would like to contribute code to this project, see [se-education.org](https://se-education.org#https://se-education.org/#contributing) for more info.
+## What is PetCode
+PetCode is a software app that aims to facilitate better working experience and boost business management efficiency for pet sale coordinators.
+
+Download [PetCode](https://github.com/AY2223S1-CS2103T-T09-2/tp/releases) to facilitate your business now.
+
+Visit our [website](https://ay2223s1-cs2103t-t09-2.github.io/tp/) to find out more.
+
+## Site Map
++ [User Guide](https://ay2223s1-cs2103t-t09-2.github.io/tp/UserGuide.html)
++ [Developer Guide](https://ay2223s1-cs2103t-t09-2.github.io/tp/DeveloperGuide.html)
++ [About us](https://ay2223s1-cs2103t-t09-2.github.io/tp/AboutUs.html)
+
+## Acknowledgements
++ This project is based on the AddressBook-Level3 project created by the [SE-EDU initiative](https://se-education.org).
diff --git a/build.gradle b/build.gradle
index 108397716bd..b2ab73b07f1 100644
--- a/build.gradle
+++ b/build.gradle
@@ -23,6 +23,7 @@ checkstyle {
test {
useJUnitPlatform()
finalizedBy jacocoTestReport
+ jvmArgs "-Djava.awt.headless=false"
}
task coverage(type: JacocoReport) {
@@ -63,10 +64,15 @@ dependencies {
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: jUnitVersion
testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: jUnitVersion
+
}
shadowJar {
- archiveFileName = 'addressbook.jar'
+ archiveFileName = 'petcode.jar'
+}
+
+run {
+ enableAssertions = true
}
defaultTasks 'clean', 'test'
diff --git a/docs/AboutUs.md b/docs/AboutUs.md
index 1c9514e966a..a1d095b91b6 100644
--- a/docs/AboutUs.md
+++ b/docs/AboutUs.md
@@ -5,55 +5,58 @@ title: About Us
We are a team based in the [School of Computing, National University of Singapore](http://www.comp.nus.edu.sg).
-You can reach us at the email `seer[at]comp.nus.edu.sg`
+You can reach us at the email `seer@comp.nus.edu.sg`
-## Project team
+## PetCode Team
-### John Doe
+### Wu Lezheng
-
+
-[[homepage](http://www.comp.nus.edu.sg/~damithch)]
-[[github](https://github.com/johndoe)]
-[[portfolio](team/johndoe.md)]
+[[github](http://github.com/Wu-Lezheng)]
+[[portfolio](team/wu-lezheng.md)]
-* Role: Project Advisor
+* Role: *UI designer, Developer, Documentation writer, Proofreader, Manual tester, Project manager*.
+* Responsibilities: Task management, creation and modification of UI, addition and modification of some features,
+ proofreading and editing of documents, manual testing and bug reporting.
-### Jane Doe
+### Zhang Weiqiang
-
+
-[[github](http://github.com/johndoe)]
-[[portfolio](team/johndoe.md)]
+[[github](http://github.com/wweqg)]
+[[portfolio](team/wweqg.md)]
-* Role: Team Lead
-* Responsibilities: UI
+* Role: Developer
+* Responsibilities: Integration
-### Johnny Doe
+### Faith Chua
-
+
-[[github](http://github.com/johndoe)] [[portfolio](team/johndoe.md)]
+[[github](http://github.com/boredcoco)]
+[[portfolio](team/boredcoco.md)]
-* Role: Developer
-* Responsibilities: Data
+* Role: *Tester, Developer*
+* Responsibilities: *Filter and Find features, testing*
-### Jean Doe
+### Huang Hongyi
-
+
-[[github](http://github.com/johndoe)]
-[[portfolio](team/johndoe.md)]
+[[github](https://github.com/Hongyi6328)]
+[[portfolio](team/hongyi6328.md)]
-* Role: Developer
-* Responsibilities: Dev Ops + Threading
+* Role: Logic Developer, Intra-structure Developer, Manual Tester, Documentation Writer, Project Manager
+* Responsibilities: Issue Manager, Milestone Manager, Official & Unofficial Meeting Minutes Maintainer, Solution
+ Architect
-### James Doe
+### Hong Ker Yen Elizabeth
-
+
-[[github](http://github.com/johndoe)]
-[[portfolio](team/johndoe.md)]
+[[github](https://github.com/elizabethhky)]
+[[portfolio](team/elizabethhky.md)]
* Role: Developer
-* Responsibilities: UI
+* Responsibilities: Delete Feature, Documentation
diff --git a/docs/AddSupplierCommandIllustration.png b/docs/AddSupplierCommandIllustration.png
new file mode 100644
index 00000000000..6afea5bb735
Binary files /dev/null and b/docs/AddSupplierCommandIllustration.png differ
diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md
index 46eae8ee565..2627d8b7926 100644
--- a/docs/DeveloperGuide.md
+++ b/docs/DeveloperGuide.md
@@ -2,14 +2,68 @@
layout: page
title: Developer Guide
---
-* Table of Contents
-{:toc}
+
+
+
PetCode Developer Guide
+Welcome to the PetCode Developer guide!
+
+PetCode is a desktop app that helps store and manage contact information for your pet sales coordination business.
+
+
+- **[Acknowledgements](#acknowledgements)**
+- **[Setting up, getting started](#setting-up-getting-started)**
+- **[Design](#design)**
+- **[Architecture](#architecture)**
+ * [UI Component](#ui-component)
+ * [Logic Component](#logic-component)
+ * [Model Component](#model-component)
+ * [Storage Component](#storage-component)
+- **[Implementation](#implementation)**
+ * [Unique ID Mechanism](#unique-id-mechanism)
+ * [Motivation](#motivation-for-unique-id)
+ * [Implementation](#implementation-of-unique-id)
+ * [Display of person list](#display-of-person-list)
+ * [Motivation](#motivation-for-display-of-person-list)
+ * [Implementation](#implementation-of-display-of-person-list)
+ * [Alternatives Considered](#alternatives-considered-for-display-of-person-list)
+ * [Pop-up window for add command](#pop-up-window-for-add-command)
+ * [Motivation](#motivation-for-pop-up-window)
+ * [Implementation](#implementation-of-pop-up-window-for-add-command)
+ * [Alternatives Considered](#alternatives-considered-for-pop-up-window)
+ * [Match feature](#match-feature)
+ * [Motivation](#motivation-for-match-feature)
+ * [Implementation of scoring system](#implementation-of-the-score-system)
+ * [Sample calculation of the score](#sample-calculation-of-the-score)
+ * [How the match feature works](#how-the-match-feature-works)
+ * [Example of how the match feature works](#example-of-how-the-match-command-works)
+ * [Areas for improvement](#areas-for-improvement-for-match-feature)
+ * [[Proposed] Undo/Redo feature](#proposed-undoredo-feature)
+- **[Documentation, logging, testing, configuration, dev-ops](#documentation-logging-testing-configuration-dev-ops)**
+- **[Appendix: Requirements](#appendix-requirements)**
+ * [Product Scope](#product-scope)
+ * [User Stories](#user-stories)
+ * [Use Cases](#use-cases)
+ * [Non-functional Requirements](#non-functional-requirements)
+ * [Glossary](#glossary)
+- **[Appendix: Instructions for manual testing](#appendix-instructions-for-manual-testing)**
+ * [Launch and shutdown](#launch-and-shutdown)
+ * [Delete a buyer](#deleting-a-buyer)
+ * [Matching a pet to an order](#matching-a-pet-to-an-order)
+ * [Saving data](#saving-data)
+- **[Appendix: Effort](#appendix-effort)**
--------------------------------------------------------------------------------------------------------------------
## **Acknowledgements**
-* {list here sources of all reused/adapted ideas, code, documentation, and third-party libraries -- include links to the original source as well}
+* The features Add, Edit, Delete were reused with minimal changes from the past project
+ [Address Book Level 3](https://github.com/nus-cs2103-AY2223S1/tp) ([UG](https://github.com/nus-cs2103-AY2223S1/tp/blob/master/docs/UserGuide.md), [DG](https://github.com/nus-cs2103-AY2223S1/tp/blob/master/docs/DeveloperGuide.md)).
--------------------------------------------------------------------------------------------------------------------
@@ -23,7 +77,10 @@ Refer to the guide [_Setting up and getting started_](SettingUp.md).
-:bulb: **Tip:** The `.puml` files used to create diagrams in this document can be found in the [diagrams](https://github.com/se-edu/addressbook-level3/tree/master/docs/diagrams/) folder. Refer to the [_PlantUML Tutorial_ at se-edu/guides](https://se-education.org/guides/tutorials/plantUml.html) to learn how to create and edit diagrams.
+:bulb: **Tip:** The `.puml` files used to create diagrams in this document can be found in
+the [diagrams](https://github.com/AY2223S1-CS2103T-T09-2/tp/tree/master/docs/diagrams) folder. Refer to the [_PlantUML
+Tutorial_ at se-edu/guides](https://se-education.org/guides/tutorials/plantUml.html) to learn how to create and edit
+diagrams.
### Architecture
@@ -36,7 +93,11 @@ Given below is a quick overview of main components and how they interact with ea
**Main components of the architecture**
-**`Main`** has two classes called [`Main`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/java/seedu/address/Main.java) and [`MainApp`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/java/seedu/address/MainApp.java). It is responsible for,
+**`Main`** has two classes
+called [`Main`](https://github.com/AY2223S1-CS2103T-T09-2/tp/blob/master/src/main/java/seedu/address/Main.java)
+and [`MainApp`](https://github.com/AY2223S1-CS2103T-T09-2/tp/blob/master/src/main/java/seedu/address/MainApp.java). 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.
@@ -49,19 +110,23 @@ The rest of the App consists of four components.
* [**`Model`**](#model-component): Holds the data of the App in memory.
* [**`Storage`**](#storage-component): 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 `delete 1`.
+The *Sequence Diagram* below shows how the components interact with each other for the scenario where the user issues
+the command `delete-b 1`.
Each of the four main components (also shown in the diagram above),
* defines its *API* in an `interface` with the same name as the Component.
-* implements its functionality using a concrete `{Component Name}Manager` class (which follows the corresponding API `interface` mentioned in the previous point.
+* implements its functionality using a concrete `{Component Name}Manager` class (which follows the corresponding
+ API `interface` mentioned 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.
+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.
@@ -69,80 +134,190 @@ The sections below give more details of each component.
### UI component
-The **API** of this component is specified in [`Ui.java`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/java/seedu/address/ui/Ui.java)
+The **API** of this component is specified
+in [`Ui.java`](https://github.com/AY2223S1-CS2103T-T09-2/tp/blob/master/src/main/java/seedu/address/ui/Ui.java)
-![Structure of the UI Component](images/UiClassDiagram.png)
+Given below is a partial class diagram of the `Ui` component.
-The UI consists of a `MainWindow` that is made up of parts e.g.`CommandBox`, `ResultDisplay`, `PersonListPanel`, `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`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/java/seedu/address/ui/MainWindow.java) is specified in [`MainWindow.fxml`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/resources/view/MainWindow.fxml)
+The UI consists of a `MainWindow` that is made up of parts including `CommandBox`, `ResultDisplay`, `StatusBarFooter`.
+The `MainWindow` also has `HelpWindow` and `AddCommandPopupWindow` that will be shown to the user when required.
+Detailed implementation of the `AddCommandPopupWindow` is written [here](#pop-up-window-for-add-command).
+All these UI components, including the `MainWindow`, inherit from the abstract `UiPart` class which captures the commonalities between
+classes that represent parts of the visible GUI.
+
+Furthermore, the `MainWindow` can be filled by **one** list panel, such as `BuyerListPanel` or `PetListPanel`, for display.
+The list panel displayed depends on the input `Command`.
+Each list panel can have any number of the corresponding card. For example, `BuyerListPanel` can have any number
+of `BuyerCard`.
+All the list panels and cards inherit from the abstract `UiPart`, but **not shown** in the diagram below to reduce graph
+complexity.
+Detailed implementation of the list panel can be found [here](#display-of-person-list).
+
+
+
+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`](https://github.com/AY2223S1-CS2103T-T09-2/tp/blob/master/src/main/java/seedu/address/ui/MainWindow.java)
+is specified
+in [`MainWindow.fxml`](https://github.com/AY2223S1-CS2103T-T09-2/tp/blob/master/src/main/resources/view/MainWindow.fxml)
The `UI` component,
* executes user commands using the `Logic` component.
* listens for changes to `Model` data so that the UI can be updated with the modified data.
* keeps a reference to the `Logic` component, because the `UI` relies on the `Logic` to execute commands.
-* depends on some classes in the `Model` component, as it displays `Person` object residing in the `Model`.
+* depends on some classes in the `Model` component, as it displays `Person` objects residing in the `Model`.
### Logic component
-**API** : [`Logic.java`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/java/seedu/address/logic/Logic.java)
+**API** : [`Logic.java`](https://github.com/AY2223S1-CS2103T-T09-2/tp/blob/master/src/main/java/seedu/address/logic/Logic.java)
Here's a (partial) class diagram of the `Logic` component:
How the `Logic` component works:
+
1. When `Logic` is called upon to execute a command, it uses the `AddressBookParser` class to parse the user command.
-1. This results in a `Command` object (more precisely, an object of one of its subclasses e.g., `AddCommand`) which is executed by the `LogicManager`.
-1. The command can communicate with the `Model` when it is executed (e.g. to add a person).
-1. The result of the command execution is encapsulated as a `CommandResult` object which is returned back from `Logic`.
+1. This results in a `Command` object (more precisely, an object of one of its subclasses e.g., `AddBuyerCommand`) which is
+ executed by the `LogicManager`.
+1. The command can communicate with the `Model` when it is executed (e.g. to add a buyer).
+1. The result of the command execution is encapsulated as a `CommandResult` object which is returned from `Logic`.
+
+The Sequence Diagram below illustrates the interactions within the `Logic` component for the `execute("delete-b 1")` API
+call.
-The Sequence Diagram below illustrates the interactions within the `Logic` component for the `execute("delete 1")` API call.
+![Interactions Inside the Logic Component for the `delete-b 1` Command](images/DeleteSequenceDiagram.png)
-![Interactions Inside the Logic Component for the `delete 1` Command](images/DeleteSequenceDiagram.png)
+
+
+:information_source: **Note:** The lifeline for `DeleteBuyerCommandParser` should end at the destroy marker (X) but due to a limitation of PlantUML, the lifeline reaches the end of diagram.
-
:information_source: **Note:** The lifeline for `DeleteCommandParser` 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:
+Given below is a diagram showing some other classes in `Logic` (omitted from the class diagram above) that can be used for parsing a user command:
-How the parsing works:
-* When called upon to parse a user command, the `AddressBookParser` class creates an `XYZCommandParser` (`XYZ` is a placeholder for the specific command name e.g., `AddCommandParser`) which uses the other classes shown above to parse the user command and create a `XYZCommand` object (e.g., `AddCommand`) which the `AddressBookParser` returns back as a `Command` object.
-* All `XYZCommandParser` classes (e.g., `AddCommandParser`, `DeleteCommandParser`, ...) inherit from the `Parser` interface so that they can be treated similarly where possible e.g, during testing.
+
+
+:information_source: **Note:** Some classes shown such as `ArgumentMultiMap`, `ArgumentTokenizer` and `CliSyntax` may not be used for some `XYZCommandParser` objects. Read the information section below for further explanation.
+
+
+
+
+
+:information_source: **Different commands have different ways of implementing their respective parsers.**
+
+**Some parsers can return different `Command` objects.**
+The `SortCommandParser` returns one of `SortCommand`'s subclasses -- `SortBuyerCommand`,
+`SortDelivererCommand`, `SortSupplierCommand`, `SortOrderCommand`, and `SortPetCommand`.
+The implementation of `SortCommandParser` was done such that the `SortCommand` is able to accept multiple inputs for the
+`LIST_TYPE` and `ATTRIBUTES` parameters. Hence, the `SortCommandParser` makes use of `SortCommandParserUtil`
+and `CommandUtil` classes which help to parse the multiple valid parameters and return the correct `SortCommand`
+subclass.
+Given below is the Parser classes diagram for the `SortCommand`.
+
+
+**Some `Command` objects are similar but have their own parsers and behave distinctly.**
+The `AddressBookParser` creates `DeleteBuyerCommandParser`, `DeleteSupplierCommandParser`,
+`DeleteDelivererCommandParser`, `DeleteOrderCommandParser`, or a `DeletePetCommandParser` depending on the user's input.
+Each `DeleteCommand` parser then returns the respective `DeleteCommand` to `AddressBookParser` for execution,
+i.e `DeleteBuyerCommandParser` parse method returns a `DeleteBuyerCommand` object.
+This way of implementation is done for commands that are very similar but have different `COMMAND_WORD`s, such as the
+AddCommand, DeleteCommand, EditCommand, FilterCommand, and FindCommand.
+Given below is the Parser classes diagram for the `DeleteCommand`.
+**`ParserUtil` and `Index` classes are omitted from the diagram to reduce graph complexity.**
+
+
+
+
+**How the parsing works:**
+
+* When called upon to parse a user command, the `AddressBookParser` class creates an `XYZCommandParser` (`XYZ` is a
+ placeholder for the specific command name e.g., `AddBuyerCommandParser`) which uses the other classes shown above to parse
+ the user command and create a `XYZCommand` object (e.g., `AddBuyerCommand`) which the `AddressBookParser` returns back as
+ a `Command` object.
+* All `XYZCommandParser` classes (e.g., `AddBuyerCommandParser`, `DeleteBuyerCommandParser`, ...) inherit from the `Parser`
+ interface so that they can be treated similarly where possible e.g, during testing.
### Model component
-**API** : [`Model.java`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/java/seedu/address/model/Model.java)
-
+**API** : [`Model.java`](https://https://github.com/AY2223S1-CS2103T-T09-2/tp/blob/master/src/main/java/seedu/address/model/Model.java)
+
+
The `Model` component,
-* stores the address book data i.e., all `Person` objects (which are contained in a `UniquePersonList` object).
-* stores the currently 'selected' `Person` objects (e.g., results of a search query) as a separate _filtered_ list which is exposed to outsiders as an unmodifiable `ObservableList` 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 `UserPref` object that represents the user’s preferences. This is exposed to the outside as a `ReadOnlyUserPref` objects.
-* does not depend on any of the other three components (as the `Model` represents data entities of the domain, they should make sense on their own without depending on other components)
+* stores the address book data i.e., all `Buyer`, `Supplier`, `Deliverer`, `Order`, and `Pet` objects (which are contained in
+ a `UniqueBuyerList`, `UniqueDelivererList`, `UniqueSupplierList`, `UniqueOrderList`, and `UniquePetList` object).
+* stores the currently 'selected' `Buyer`, `Supplier`, `Deliverer`, `Order`, and `Pet` objects (e.g., results of a
+ search query) as a separate _filtered_ list which is exposed to outsiders as an unmodifiable `ObservableList`,
+ `ObservableList`, `ObservableList`, `ObservableList`, `ObservableList` 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 `UserPref` object that represents the user’s preferences. This is exposed to the outside as
+ a `ReadOnlyUserPref` objects.
+* does not depend on any of the other three components (as the `Model` represents data entities of the domain, they
+ should make sense on their own without depending on other components)
-
:information_source: **Note:** An alternative (arguably, a more OOP) model is given below. It has a `Tag` list in the `AddressBook`, which `Person` references. This allows `AddressBook` to only require one `Tag` object per unique tag, instead of each `Person` needing their own `Tag` objects.
+
-
+:information_source: **How Different Address Book Objects are Stored:**
+The diagrams given below contains more details on how each `Buyer`, `Supplier`,
+`Deliverer`, `Order` and `Pet` objects are stored in the Model component.
-
+For more information on what each object represents, refer to the [Glossary](#glossary) section.
+**`Buyer` and `Deliverer` Class**
+
+Both the `Buyer` and `Deliverer` classes inherit from the `Person` class and have an orders attribute.
+Each order has an `UniqueId` for easier identification. Hence, the orders are stored as a collection of `UniqueId`
+objects to easily access unique orders. Given below is the class diagram for the **`Buyer`** Class:
+
+
+
+**`Supplier` Class**
+
+Similar to the `Buyer` and `Deliverer` class, the `Supplier` class inherits from the `Person` class. However, instead of
+an orders attribute, the `Supplier` class has a pets attribute to represent the pets sold by the `Supplier`.
+Similar to an order, each pet has an `UniqueId` for easier identification. Hence, the pets are stored as a collection of
+`UniqueId` objects to easily access unique pets. Given below is the class diagram for the **`Supplier`** Class:
+
+
+
+**`Order` Class**
+
+The `Order` class consists of several attributes. The most important attribute to take note of is the Buyer as
+every order should be made by a Buyer. Given below is the class diagram for the **`Order`** Class:
+
+
+
+**`Pet` Class**
+
+The `Pet` class consists of several attributes. The most important attribute to take note of is the Supplier as
+every pet should be sold by a Supplier. Given below is the class diagram for the **`Pet`** Class:
+
+
+
+
### Storage component
-**API** : [`Storage.java`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/java/seedu/address/storage/Storage.java)
+**API** : [`Storage.java`](https://github.com/AY2223S1-CS2103T-T09-2/tp/blob/master/src/main/java/seedu/address/storage/Storage.java)
-
+
The `Storage` component,
-* can save both address book data and user preference data in json format, and read them back into corresponding objects.
-* inherits from both `AddressBookStorage` and `UserPrefStorage`, which means it can be treated as either one (if only the functionality of only one is needed).
-* depends on some classes in the `Model` component (because the `Storage` component's job is to save/retrieve objects that belong to the `Model`)
+
+* can save both address book data and user preference data in json format, and read them back into corresponding
+ objects.
+* inherits from both `AddressBookStorage` and `UserPrefStorage`, which means it can be treated as either one (if only
+ the functionality of only one is needed).
+* depends on some classes in the `Model` component (because the `Storage` component's job is to save/retrieve objects
+ that belong to the `Model`)
### Common classes
@@ -152,31 +327,316 @@ Classes used by multiple components are in the `seedu.addressbook.commons` packa
## **Implementation**
-This section describes some noteworthy details on how certain features are implemented.
+This section describes some noteworthy details on how certain features and functionalities are implemented.
+
+### Unique ID Mechanism
+
+#### Motivation for unique ID
+The `Buyer` object has a reference to `Order` object(s) and an `Order` object also has reference to a `Buyer` object.
+Similarly, the `Supplier` object has a reference to `Pet` object(s) and vice versa.
+This bidirectional association makes it difficult to implement some JSON-related classes and methods,
+since the JSON-adapted models will recursively write these references into the `.json` file for infinite number of times.
+
+#### Implementation of unique ID
+Our solution to this problem is to give each `Order` and `Pet` a unique ID that does not change throughout the life
+cycle of `Order` or `Pet` object.
+
+We considered using a unique `int` or `long` data type to represent the id, but either `int` or `long` is possible to
+have overflow (though very unlikely), resulting in duplicate IDs. Therefore, we thought of another approach, which is
+strings.
+
+We regard a string as a base 26 number (`'a'` - `'z'`). Every time the least significant digit shifts from `'z'`
+to `'a'`, we do a carry to the more significant digit. Repeat this step until there is no more carry or the most
+significant digit has a carry. In the latter case, we append another `'a'` as the most significant digit. As shown below.
+
+
+
+
+For efficiency, the ID generator is implemented by a `List` of `char`, which avoids frequent string copying and
+concatenating. `List` facilitates fast in-place edit of a single `char` at a single index as well.
+
+### Display of person list
+
+#### Motivation for display of person list
+
+Given below is a partial class diagram of the **old UI**.
+
+
+
+Initially, there is only one `PersonListPanel` that displays the person list using `PersonCard`.
+However, our product classifies `Person` into three different categories -- `Buyer`, `Supplier`, and `Deliverer`.
+Therefore, it is necessary to have a **separate list panel** for each of these three types of `Person`.
+
+In addition, buyers, suppliers and deliverers have comprehensive information on the orders or pets that they possess (not implemented for deliverers yet),
+besides their contact information.
+A `PersonCard` with only `Label` of JavaFX will display information in a very unorganised and lengthy way, which is
+difficult for users to obtain information quickly.
+Therefore, the UI needs to be **optimised for the situation where there is plentiful information** that the user wants
+to know about a single `Person`.
+
+#### Implementation of display of person list
+
+In the implementation as seen in the diagram below, the `MainWindow` can be filled by any one of the following
+depending on the `Command` executed:
+
+* `BuyerListPanel`: displays information about each `Buyer` using a `BuyerCard` in a `ListView`.
+* `SupplierListPanel`: displays information about each `Supplier` using a `SupplierCard` in a `ListView`.
+* `DelivererListPanel`: displays information about each `Deliverer` using a `DelivererCard` in a `ListView`.
+* `MainListPanel`: displays a master list which includes all `Buyer`, `Supplier`, and `Deliverer` In a `ListView`.
+* `OrderListPanel`: displays information about each `Order` using an `OrderCard` in a `ListView`.
+* `PetListPanel`: displays information about each `Pet` using a `PetCard` in a `ListView`.
+
+*Note that each person card (`BuyerCard`, `DelivererCard`, `SupplierCard`) can have any number of the corresponding item
+cards (`OrderCard`, `PetCard`).*
+
+
+
+By having separate list panels, it will be easier to customise the display of different `Person` types as well
+as `Order` and `Pet` if required by future features and ui improvements.
+
+In each `BuyerCard` as seen in the image below, the buyer's `Name` will be shown together with an index and a label
+indicating that (s)he is a `Buyer`.
+* The left side of the `BuyerCard` displays the contact information of the `Buyer`, including `Phone`, `Email`, `Location`, and `Address`.
+* The right side of the `BuyerCard` is visually enhanced by adding a `ListView` of `OrderCard`, which displays the information of
+each `Order` that the `Buyer` has made. Each `Order` is also given an index in the list.
+
+
+
+In each `SupplierCard`, the structure is similar to that of the `BuyerCard` except the right side of the card.
+Instead of a `ListView` of `OrderCard`, it has a `ListView` of `PetCard` which displays the information of each
+`Pet` that the `Supplier` sells. Each `Pet` is also given an index in the list.
+
+By modifying the `PersonCard` to the three types of cards stated above, divided into a left section which shows contact
+details, and a right section which is a `ListView`, we can keep the information displayed organised and maintain the
+height of each card within a reasonable range
+(e.g. if the orders are displayed as plain text below the buyer's contact information, the card will be stretched
+vertically, potentially to an extent that the whole window can only show information of one single buyer).
+
+#### Alternatives considered for display of person list
+
+* **Alternative 1 (current choice):** Has only one display window and displays items (`Order` or `Pet`) together with
+ the person.
+ * Pros: Easy to implement and can view all the information immediately after a command is executed.
+ * Cons: Too cramped, which may lead to information overload.
+* **Alternative 2:** Has one display window for person and a separate display window for items, as shown below.
+ * Pros: More organised and visually pleasant.
+ * Cons: Hard to implement and need one more command such as `display INDEX` to display the information of the person or item.
+
+
+
+### Pop-up window for add command
+
+#### Motivation for pop-up window
+
+If the user wants to add a `Buyer` with multiple `Order`, or add a `Supplier` with multiple `Pet`,
+the user has to repetitively enter a lot of prefixes.
+The user also needs to memorise the prefixes for each attribute of the person or item, and they may get lost when entering such a long command.
+
+Therefore, we recognise the need for a pop-up window for adding a `Person` (`Buyer` or `Supplier` for the current version),
+which has text fields that **prompt** the user to enter the required information **without prefixes**.
+
+#### Implementation of pop-up window for add command
+
+Given below is the partial class diagram of `Ui` component related to `AddCommandPopupWindow`.
+
+
+
+The `AddCommandPopupWindow` is made up of either `PopupPanelForBuyer` or `PopupPanelForSupplier`, depending on the type of `Person` that the user wants to add.
+`PopupPanelForBuyer` can have any number of `PopupPanelForOrder`, while `PopupPanelForSupplier` can have any number of `PopupPanelForPet`.
+All the pop-up panels inherit from an abstract class `PopupPanel`, which captures the commonalities between classes that represent parts of the content in pop-up window.
+
+Each subclass of `PopupPanel` can generate a `Command` based on the attributes specified in some classes of the `Model` component. Therefore, it has a dependency on the `Model` component.
+The `Command` is then passed to `AddCommandPopupWindow`, which keeps a reference to `Logic` for the execution of the given `Command`, and a reference to `ResultDisplay` for the display of `CommandResult` in the `MainWindow`.
+
+Given below is the sequence diagram showing how the command line `add supplier` creates the pop-up window step by step.
+
+
+
+**How the pop-window for adding a `Supplier` is created:**
+
+1. Based on the graph above, after the user enters the command line "add supplier", `MainWindow` calls `LogicManager#execute(String)`.
+2. The user input is then parsed by `AddressBookParser` and an `AddCommandWithPopup` instance is created.
+3. `LogicManager` then executes the `AddCommandWithPopup` and returns the `CommandResult` back to the `MainWindow`
+4. The `MainWindow` recognises from the result that a pop-up window is required for adding a `Supplier`, and invokes the `handleAddByPopup` method in itself.
+5. The `handleAddByPopup` method then creates a `AddCommandPopupWindow`, which has a `StackPane`. The `StackPane` is in turn filled by a `PopupPanelForSupplier`.
+6. The filled `AddCommandPopupWindow` is displayed to the user.
+
+After the pop-up window is created, the user enters information about the `Supplier` in the provided text fields and saves the inputs. The sequence diagram below illustrates how the pop-up window deals with user inputs on saving step by step.
+
+
+
+**How the user's input for a `Supplier` in the pop-window is saved:**
+1. The UI detects there is a saving action (either by pressing the save button or using `CTRL + S`).
+2. The `AddCommandPopupWindow` calls `PopupPanelForSupplier#checkAllPartsFilled`. If there is at least one compulsory text field without any user input, the pop-up window will do nothing.
+3. If all required text fields have user inputs, the `AddCommandPopupWindow` tries to generate a `Command`, during which the `PopupPanelForSupplier` generates a `supplier` using the `generateSupplier()` method in itself.
+4. The generation of a `Supplier` invokes the corresponding static methods in the `ParserUtil` class for each of the supplier's attribute, until all inputs are parsed.
+5. **(NOT SHOWN IN DIAGRAM)** When there are subcomponents in the `PopupPanelForSupplier` (`PopupPanelForPet` in this context), it also parses the inputs in these subcomponents by calling `PopupPanelForPet#generatePet()` after the `generateSupplier` call.
+6. The generated `Supplier` (with / without `Pet`) is used to create an `AddSupplierCommand` instance, which is then returned to the `AddCommandPopupWindow`.
+7. The `AddCommandPopupWindow` executes the `AddSupplierCommand` instance, and gets back the `CommandResult`.
+
+The following activity diagram summarises how the UI responds to an add command with the pop-up window.
+
+
+
+
+
+To cater to people who can **type fast**, **keyboard shortcuts** are included in the pop-up window.
+For example, pressing `ESC` closes the pop-up window without saving, and pressing `CTRL + S` saves the user input and closes the pop-up window.
+This is achieved using `EventHandler`, `EventFilter` and `KeyCodeCombination` of JavaFX.
+
+
+
+#### Alternatives considered for pop-up window
+* **Alternative 1 (current choice):** Has a separate pop-up window when a `Command` in the form similar to `add supplier` is entered by the user, with multiple text fields that contain prompt text for the user to input.
+ * Pros: Recognition rather than recall, reducing the user's need to memorise the prefixes required.
+ * Cons: Hard to implement, less CLI in nature.
+* **Alternative 2 (also implemented):** Has a `Command` that can add a `Person` with multiple `Order`/`Pet` by prefixes in the `CommandBox` (single text field, no prompt text) of the `MainWndow`.
+ * Pros: Easy to implement, more CLI in nature.
+ * Cons: Tedious when entering the `Command`, a lot of memorisation work to remember the prefixes.
+
+### Match feature
+
+#### Motivation for Match feature
+
+Our target user, pet sales coordinators, needs to find out which pet for sale is the best fit for an order placed by
+a buyer. In an `Order`, the buyer can specify attributes such as the age of the pet (s)he wants, the acceptable price interval, and more. We
+have intentionally set up the same attributes for a `Pet` object.
+
+Since there are many attributes the user has to take note of when finding the best fit pet for an order, we have
+implemented the `Match` feature which makes comparisons between the attributes of the `Order` object and `Pet` objects to
+find the best fit pet.
+
+#### Implementation of the score system
+
+We use a score to determine how close a pet matches an order. As shown below, the total score `S` is the sum of `n`
+sub-scores.
+Every sub-score is the product of an indicator variable `s_i` and a weight `w_i`. Every indicator-weight pair
+corresponds to an attribute that both `Pet` and `Order` have.
+
+
+
+The indicator variable depends on the attribute it corresponds to. There are two types of indicators:
+
+1. **Must-have indicators**: They are 1 if the attribute in `Pet` is exactly the same as that in `Order`, otherwise 0.
+2. **Deviation indicators**: They are 1 if the attribute in `Pet` is within the expected range of value for the same
+ attribute in `Order`. How close these indicators are to 1 indicates the deviation the attribute in `Pet` has from the
+ expected value of the attribute in `Order`, i.e The larger the deviation from 1, the larger the deviation is from the
+ `Order` expected value.
+
+We use **must-have indicators** and **high weights** for **must-have attributes**. For example, if the species of the pet is exactly
+what the buyer wants, then the must-have indicator is 1 and the weight given is high. This results in a high sub-score
+given to the attribute, "pet species".
+The **rationale** behind this is that a buyer certainly prioritises the species of the pet (s)he wants, even if other
+factors are slightly different from what is expected.
+
+We use **deviation indicators** and **low weights** for **lower-priority attributes**. For example, if the price of a pet
+just falls in the expected price range of an order, then the deviation indicator is 1. Otherwise, the value of the indicator
+depends on how far the pet's price is away from the range.
+
+#### Sample calculation of the score
+
+| Field | Pet | Requested by Order | Indicator | Weight | Sub-score |
+|---------------|-------------|--------------------|------------------|--------|----------------|
+| Age | 4 | 5 | 1 - abs(4 - 5) | 30 | 0 * 30 = 0 |
+| Color | White | Black | 0 | 100 | 0 * 100 = 0 |
+| Color pattern | Dotted | None | 0 | 100 | 0 * 100 = 0 |
+| Species | Persian cat | Persian cat | 1 | 500 | 1 * 500 = 500 |
+| Price (range) | 50 | 90, 100 | 1 - abs(90 - 50) | 5 | -39 * 5 = -195 |
+
+In the implementation of our Match feature, the attributes `Color`, `ColorPattern` and `Species` are **must-have
+attributes** and thus the indicators for these attributes are **must-have indicators**. The attributes `Age` and `Price`
+are **lower-priority attributes** and thus the indicators for these attributes are **deviation indicators**.
+
+Based on the table above, the total score for this pet is 0 + 0 + 0 + 500 - 195 = **305**.
+
+#### How the match feature works
+
+With the scoring system, we calculate the score of all pets against an order and sort these pets in descending order of
+their calculated score. This is sorted list of pets is then displayed to the user in the MainWindow.
+The pets at the top of the displayed list are likely to be the best fit.
+
+Given below are the sequence diagrams when `match 1` is executed.
+
+
+
+**How the `MatchCommand` is created for `match 1`:**
+
+1. When `Logic` is called upon to execute the `match 1` command, it uses the `AddressBookParser` class to parse the user input.
+2. This results in a `MatchCommandParser` object created to parse the parameter supplied by the user, "1", to create a `MatchCommand`.
+3. The `MatchCommand` created is then passed back to the `MatchCommandParser`.
+4. The `MatchCommandParser` then passes the created `MatchCommand` back to the `AddressBookParser`.
+5. The `AddressBookParser` then passes the created `MatchCommand` back to `LogicManager` for execution.
+
+
+
+**How the `MatchCommand` is executed for `match 1`:**
+1. **(NOT SHOWN IN DIAGRAM)** The `MatchCommand` gets the `Order` and `Pet` lists and from `Model` and stores the lists as local variables.
+2. **(NOT SHOWN IN DIAGRAM)** The `MatchCommand` then uses the `Order` list to retrieve the `Order` at the specified index, which is "1" in this context.
+3. A `PetGrader` object is then created to be used for evaluating the scores of each `Pet` in the `Pet` list against the `Order`.
+4. A `HashMap` object is then created to be used for storing the score for each `Pet`.
+5. Each `Pet` in the `Pet` list is then evaluated by the `PetGrader` object and their scores are stored in the `HashMap` object.
+6. A `Comparator` object is created to be used for comparing the scores of the `Pet` objects.
+7. **(NOT SHOWN IN DIAGRAM)** The `Comparator` object then compares the scores of the `Pet` objects stored in the `HashMap` object and sorts them.
+8. The `MatchCommand` calls on the method `sortPets` in the `Model` using the `Comparator` object created. This sorts the `Pet` list in `Model` according to descending order of the `Pet` calculated scores.
+9. The `MatchCommand` then calls on the method `switchToPetList` in `Model` to display the sorted `Pet` list to the user.
+10. A `CommandResult` object is then created in the `MatchCommand` and passed back to the `LogicManager`, to display the success message.
+
+#### Example of how the match command works
+To have a deeper understanding of what it does, take a look at the two diagrams below. Take the four pets Shiro,
+Ashy, Page and Snowy as examples. Plum and Buddy are ignored for simplicity.
+
+**We assign a score to each pet according to how many attributes they have are the same as requested, and how much
+deviation, if they don’t fit, the attributes have from expected values.** The higher the score, the more suitable the pet.
+In this table, Shiro has all requested attributes except its price. However, its price is too far away from the
+acceptable range fifty to ninety, so a very low score. Ashy does not satisfy any requirement, so another low score. In
+the next row, some of Page’s attributes fit and the others do not, so an intermediate score. Finally, although Snowy is
+a little bit old, it satisfies all other requirements. Because the difference between its age and the expected age is
+not too big, it has a high overall score.
+
+![img.png](images/MatchCommandIllustration1.png)
+
+The next thing our app will do is sort the pets by their scores. This sorted list will be displayed on the screen. Now,
+as a smart pet sale coordinator who wants to maximise utility and profit, you may want to sell Snowy to this customer.
+
+![img.png](images/MatchCommandIllustration2.png)
+
+#### Areas for improvement for Match feature
+
+At this stage, the weights are pre-set and fixed, so the score may not truly reflect how important each attribute is from
+a buyer's or a sale coordinator's perspective. In future implementations, we will allow users to configure these weights,
+if they don't want to use the default weights.
### \[Proposed\] Undo/redo feature
#### Proposed Implementation
-The proposed undo/redo mechanism is facilitated by `VersionedAddressBook`. It extends `AddressBook` with an undo/redo history, stored internally as an `addressBookStateList` and `currentStatePointer`. Additionally, it implements the following operations:
+The proposed undo/redo mechanism is facilitated by `VersionedAddressBook`. It extends `AddressBook` with an undo/redo
+history, stored internally as an `addressBookStateList` and `currentStatePointer`. Additionally, it implements the
+following operations:
-* `VersionedAddressBook#commit()` — Saves the current address book state in its history.
-* `VersionedAddressBook#undo()` — Restores the previous address book state from its history.
-* `VersionedAddressBook#redo()` — Restores a previously undone address book state from its history.
+* `VersionedAddressBook#commit()`— Saves the current address book state in its history.
+* `VersionedAddressBook#undo()`— Restores the previous address book state from its history.
+* `VersionedAddressBook#redo()`— Restores a previously undone address book state from its history.
-These operations are exposed in the `Model` interface as `Model#commitAddressBook()`, `Model#undoAddressBook()` and `Model#redoAddressBook()` respectively.
+These operations are exposed in the `Model` interface as `Model#commitAddressBook()`, `Model#undoAddressBook()`
+and `Model#redoAddressBook()` 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 `VersionedAddressBook` will be initialized with the initial address book state, and the `currentStatePointer` pointing to that single address book state.
+Step 1. The user launches the application for the first time. The `VersionedAddressBook` will be initialized with the
+initial address book state, and the `currentStatePointer` pointing to that single address book state.
![UndoRedoState0](images/UndoRedoState0.png)
-Step 2. The user executes `delete 5` command to delete the 5th person in the address book. The `delete` command calls `Model#commitAddressBook()`, causing the modified state of the address book after the `delete 5` command executes to be saved in the `addressBookStateList`, and the `currentStatePointer` is shifted to the newly inserted address book state.
+Step 2. The user executes `delete-b 5` command to delete the 5th buyer in the address book. The `delete` command
+calls `Model#commitAddressBook()`, causing the modified state of the address book after the `delete-b 5` command executes
+to be saved in the `addressBookStateList`, and the `currentStatePointer` is shifted to the newly inserted address book
+state.
![UndoRedoState1](images/UndoRedoState1.png)
-Step 3. The user executes `add n/David …` to add a new person. The `add` command also calls `Model#commitAddressBook()`, causing another modified address book state to be saved into the `addressBookStateList`.
+Step 3. The user executes `add-b n/David …` to add a new person. The `add-b` command also calls `Model#commitAddressBook()`
+, causing another modified address book state to be saved into the `addressBookStateList`.
![UndoRedoState2](images/UndoRedoState2.png)
@@ -184,7 +644,9 @@ Step 3. The user executes `add n/David …` to add a new person. The `add` co
-Step 4. The user now decides that adding the person was a mistake, and decides to undo that action by executing the `undo` command. The `undo` command will call `Model#undoAddressBook()`, which will shift the `currentStatePointer` once to the left, pointing it to the previous address book state, and restores the address book to that state.
+Step 4. The user now decides that adding the person was a mistake, and decides to undo that action by executing
+the `undo` command. The `undo` command will call `Model#undoAddressBook()`, which will shift the `currentStatePointer`
+once to the left, pointing it to the previous address book state, and restores the address book to that state.
![UndoRedoState3](images/UndoRedoState3.png)
@@ -201,17 +663,23 @@ The following sequence diagram shows how the undo operation works:
-The `redo` command does the opposite — it calls `Model#redoAddressBook()`, which shifts the `currentStatePointer` once to the right, pointing to the previously undone state, and restores the address book to that state.
+The `redo` command does the opposite — it calls `Model#redoAddressBook()`, which shifts the `currentStatePointer` once
+to the right, pointing to the previously undone state, and restores the address book to that state.
:information_source: **Note:** If the `currentStatePointer` is at index `addressBookStateList.size() - 1`, pointing to the latest address book state, then there are no undone AddressBook states to restore. The `redo` command uses `Model#canRedoAddressBook()` 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`. Commands that do not modify the address book, such as `list`, will usually not call `Model#commitAddressBook()`, `Model#undoAddressBook()` or `Model#redoAddressBook()`. Thus, the `addressBookStateList` remains unchanged.
+Step 5. The user then decides to execute the command `list buyer`. Commands that do not modify the address book, such
+as `list buyer`, will usually not call `Model#commitAddressBook()`, `Model#undoAddressBook()` or `Model#redoAddressBook()`.
+Thus, the `addressBookStateList` remains unchanged.
![UndoRedoState4](images/UndoRedoState4.png)
-Step 6. The user executes `clear`, which calls `Model#commitAddressBook()`. Since the `currentStatePointer` is not pointing at the end of the `addressBookStateList`, all address book states after the `currentStatePointer` will be purged. Reason: It no longer makes sense to redo the `add n/David …` command. This is the behavior that most modern desktop applications follow.
+Step 6. The user executes `clear`, which calls `Model#commitAddressBook()`. Since the `currentStatePointer` is not
+pointing at the end of the `addressBookStateList`, all address book states after the `currentStatePointer` will be
+purged. Reason: It no longer makes sense to redo the `add-b n/David …` command. This is the behavior that most modern
+desktop applications follow.
![UndoRedoState5](images/UndoRedoState5.png)
@@ -234,11 +702,6 @@ The following activity diagram summarizes what happens when a user executes a ne
_{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**
@@ -257,71 +720,238 @@ _{Explain here how the data archiving feature will be implemented}_
**Target user profile**:
-* has a need to manage a significant number of contacts
-* prefer desktop apps over other types
-* can type fast
-* prefers typing to mouse interactions
-* is reasonably comfortable using CLI apps
+Coordinators of pet sale who need a contact list of both clients, deliverers and suppliers. These coordinators run their
+business online and get used to typing. Such people need to maintain a contact list of clients, deliverers, and
+suppliers.
+
+* get used to desktop for their online business, and can type fast
+* meet a lot of people online
+* need to contact a lot of people on a regular basis
+* need to keep track of fast-growing pets
+* need to find suppliers for customer demands
+* need to find customers for suppliers' pets
+* need to do demand-supply matching
+* need to arrange international deliveries
-**Value proposition**: manage contacts faster than a typical mouse/GUI driven app
+**Value proposition**:
+
+* It is difficult to coordinate (international) pet sales. Suppliers have pets for sale, and clients may have a rough
+ idea about what pets they want to buy. Once the need and the supply match, deliverers have to carry out the deal. Such
+ need-supply matching and international pet shipment is difficult to manage. Our app will serve as a more convenient
+ tool for pet sale coordinators to manage the whole process. Our app will record the needs of clients, current unsold
+ pets from suppliers, and deliverers’ details. It will automatically match the best-fit pet to a client’s needs.
+* Coordinators who run their business online need delivery. Given the location (country) of the client and the supplier,
+ our app will generate a list of deliverers who have a service over the line, based on records.
+* Unlike other products, pets need a certificate to be legally sold - including photos of the animals, whether they are
+ pure-bred etc. Our app will also help manage certificates.
### User stories
Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unlikely to have) - `*`
-| Priority | As a … | I want to … | So that I can… |
-| -------- | ------------------------------------------ | ------------------------------ | ---------------------------------------------------------------------- |
-| `* * *` | new user | see usage instructions | refer to instructions when I forget how to use the App |
-| `* * *` | user | add a new person | |
-| `* * *` | user | delete a person | remove entries that I no longer need |
-| `* * *` | user | find a person by name | locate details of persons without having to go through the entire list |
-| `* *` | user | hide private contact details | minimize chance of someone else seeing them by accident |
-| `*` | user with many persons in the address book | sort persons by name | locate a person easily |
-
-*{More to be added}*
+| Priority | As a … | I want to … | So that I can… |
+|----------|---------------------------------------------------------------------------|-----------------------------------------------------------------------------------------|-----------------------------------------------------------------|
+| `* * *` | pet sale coordinator who has new partnerships | add contacts of buyers, deliverers and suppliers | keep in touch with them whenever needed. |
+| `* * *` | pet sale coordinator who types fast | add contacts of buyers, deliverers and suppliers using CLI | efficiently manage my business. |
+| `* *` | pet sale coordinator who is more familiar with GUI | add contacts of buyers, deliverers and suppliers using GUI | not be confused by CLI commands and prefixes. |
+| `* * *` | pet sale coordinator | be able to delete any contacts of people | remove entries that I no longer need. |
+| `* *` | pet sale coordinator whose clients change their contacts frequently | be able to edit contact information about clients | get their latest number and address for easy contact. |
+| `* *` | pet sale coordinator | be able to find all contacts (buyers, suppliers, deliverers) by attributes (e.g. email) | not waste time searching for a specific contact details. |
+| `* * *` | pet sale coordinator | list a summary of all contacts in storage | have an overview of my network. |
+| `* *` | pet sale coordinator who has business partners from different backgrounds | sort all contacts by attributes (e.g. name) | have a more organised view of my business partners. |
+| `* * *` | pet sale coordinator | add an order to a buyer | keep track of they want to buy and what their requirements are. |
+| `* * *` | organised pet sale coordinator | delete an order from a buyer | free up storage and clean workplace. |
+| `* * *` | pet sale coordinator | list a summary of all orders from the buyers in storage | have an overview of what the buyers want. |
+| `* *` | pet sale coordinator | be able to filter all orders by attributes (e.g. price range) | not waste time searching for a specific order. |
+| `* *` | pet sale coordinator | check which buyer is associated with an order | see the contact detail of the buyer to negotiate. |
+| `* *` | pet sale coordinator with many orders to handle | sort the orders from the buyers based on their urgency (time) | know which order I should deal with first. |
+| `* * *` | pet sale coordinator | add a pet to a supplier | keep track of what they want to sell and their stock situation. |
+| `* * *` | organised pet sale coordinator | delete a pet from a supplier | free up storage and clean workplace. |
+| `* * *` | pet sale coordinator | list a summary of all pets from the suppliers in storage | have an overview of what the suppliers have. |
+| `* * *` | pet sale coordinator | be able to filter all pets by attributes (e.g. color) | not waste time searching for a specific pet. |
+| `* *` | pet sale coordinator | check which supplier is associated with a pet | see the contact detail of the supplier to negotiate. |
+| `* * *` | pet sale coordinator with many pets | find the pet that best matches a specific order | efficiently find the best pet for my client. |
+| `* * *` | pet sale coordinator with many pets available for sale | sort the pets based on relevance (e.g. price) | know which pet is the most relevant to my concern |
+| `*` | beginner user | read guides and seek help | know how to use PetCode |
+| `*` | normal user | quit when I do not need it for now | save my computer resources |
+| `*` | pet sale coordinator with messy records of contacts and items | clear all records | start from the beginning to organise my data |
### 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 `PetCode` and the **Actor** is the `User`, unless specified otherwise)
-**Use case: Delete a person**
+**Use case: UC01 - Listing contacts / items**
**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 specifies which list to show.
+2. PetCode displays the specified list.
- Use case ends.
+Use case ends.
**Extensions**
-* 2a. The list is empty.
+1a. PetCode detects that the list being specified by the User does not exist.
+ 1a1. PetCode notifies User that the list does not exist.
+ 1a2. User specifies new list.
+ Steps 1a1-1a2 are repeated until the list exists.
+ Use case resumes from step 2.
+
+Use case ends.
- Use case ends.
+**Use case: UC02 - Adding an Order from a Buyer**
-* 3a. The given index is invalid.
+**MSS**
- * 3a1. AddressBook shows an error message.
+1. User specifies who the buyer is and keys in the buyer's order details.
+2. PetCode saves this order.
+3. PetCode displays the updated buyer list with the specified buyer having a new order.
- Use case resumes at step 2.
+Use case ends.
-*{More to be added}*
+**Extensions**
-### Non-Functional Requirements
+1a. PetCode detects that the specified buyer does not exist.
+ 1a1. PetCode notifies the User that the buyer does not exist.
+ 1a2. User specifies new buyer.
+ Steps 1a1-1a2 are repeated until the buyer exists.
+ Use case resumes from step 2.
-1. Should work on any _mainstream OS_ as long as it has Java `11` or above installed.
-2. Should be able to hold up to 1000 persons without a noticeable sluggishness in performance for typical usage.
-3. 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.
+1b. PetCode detects that there are missing / invalid order details.
+ 1b1. PetCode notifies the User that there are missing / invalid order details.
+ 1b2. User specifies keys in new order details.
+ Steps 1b1-1b2 are repeated until the order details are valid.
+ Use case resumes from step 2.
-*{More to be added}*
+**Use case: UC03 - Deleting a contact / item**
+
+**MSS**
+
+1. User specifies the type of contact / item and the index of the contact / item they want to delete.
+2. PetCode searches for this contact / item.
+3. PetCode removes this contact / item from the list.
+4. PetCode notifies user that contact / item has been deleted from the list and displays updated contact / item list.
+
+Use case ends.
+
+**Extensions**
+
+2a. PetCode detects that the specified contact / item does not exist.
+ 2a1. PetCode notifies the User that the contact / item does not exist.
+ 2a2. User specifies new contact / item.
+ Steps 2a1-2a2 are repeated until the contact / item exists.
+ Use case resumes from step 3.
+
+Use case ends.
+
+**Use case: UC04 - Finding a contact based on an attribute**
+
+**MSS**
+
+1. User specifies whether (s)he is searching for a Buyer, Supplier or Deliverer, or any kind of contact and the target attribute.
+3. PetCode searches for all Buyers, Suppliers or Deliverers with that specified target attribute.
+4. PetCode displays these Buyers, Suppliers, Deliverers or all three.
+
+Use case ends.
+
+**Extensions**
+
+1a. User inputs an invalid contact type / missing the contact type.
+ 1a1. PetCode notifies the User that the contact type is invalid / missing.
+ 1a2. User specifies new contact type.
+ Steps 1a1-1a2 are repeated until the contact type is valid.
+ Use case resumes from step 2.
+
+1b. User inputs an invalid / missing target attribute.
+ 1b1. PetCode notifies the User that the target attribute is invalid / missing.
+ 1b2. User specifies new target attribute.
+ Steps 1b1-1b2 are repeated until the target attribute is valid.
+ Use case resumes from step 2.
+
+**Use case: UC05 - Sorting contacts / items**
+
+**MSS**
+
+1. User specifies the contacts / items list to sort and the attribute(s) to sort by.
+2. PetCode sorts the specified list in descending order according to the specified attribute(s).
+3. PetCode displays the sorted list to the User.
+
+Use case ends.
+
+**Extensions**
+
+1a. PetCode detects that the specified list is invalid.
+ 1a1. PetCode notifies User that the list specified is invalid.
+ 1a2. User specifies new list type.
+ Steps 1a1-1a2 are repeated until the list type is valid.
+ Use case resumes from step 2.
+
+1b. PetCode detects that the specified attribute(s) is / are invalid.
+ 1a1. PetCode notifies User that the specified attribute(s) is / are invalid.
+ 1a2. User specifies new attribute(s).
+ Steps 1a1-1a2 are repeated until the attribute(s) is / are valid.
+ Use case resumes from step 2.
+
+**Use case: UC06 - Filtering items**
+
+**MSS**
+
+1. User specifies the type of items list to filter and keys in the target attribute(s) (s)he is searching for in an item.
+2. PetCode searches for all specified items with target attribute(s), depending on what the user has specified.
+3. PetCode displays all items that match the target attribute(s).
+
+Use case ends.
+
+**Extensions**
+
+1a. PetCode detects that the specified list is invalid.
+ 1a1. PetCode notifies User that the list specified is invalid.
+ 1a2. User specifies new list type.
+ Steps 1a1-1a2 are repeated until the list type is valid.
+ Use case resumes from step 2.
+
+1b. PetCode detects that the specified attribute(s) is / are invalid.
+ 1a1. PetCode notifies User that the specified attribute(s) is / are invalid.
+ 1a2. User specifies new attribute(s).
+ Steps 1a1-1a2 are repeated until the attribute(s) is / are valid.
+ Use case resumes from step 2.
+
+**Use case: UC07 - Checking the buyer of an order**
+
+**MSS**
+
+1. User specifies the order list and the index of the order to be checked.
+2. PetCode searches for the order at the specified index.
+3. PetCode searches for the buyer of that specified order.
+4. PetCode outputs the buyer of that order.
+
+Use case ends.
+
+**Extensions**
+
+1a. The index is not a valid index.
+ 1a1. PetCode notifies user that the index is invalid.
+ 1a2. User specifies new index.
+ Steps 1a1-1a2 are repeated until the index is valid.
+ Use case resumes from step 2.
+
+### Non-Functional Requirements
+
+1. Should work on any _mainstream OS_ as long as it has Java `11` or above installed.
+2. Should be able to hold up to 1000 persons without a noticeable sluggishness in performance for typical usage.
+3. 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.
+4. The user interface should be intuitive enough for users who are not IT-savvy.
### Glossary
+* **Buyer**: A customer of the pet sale coordinator interested in purchasing a pet.
+* **Deliverer**: A person that is able to provide delivery services from the supplier to buyer/client.
+* **Supplier**: A person that has pets on sale.
+* **Item**: An order or a pet.
+* **Contact / Person**: A buyer/client, or a deliverer, or a supplier.
* **Mainstream OS**: Windows, Linux, Unix, OS-X
-* **Private contact detail**: A contact detail that is not meant to be shared with others
--------------------------------------------------------------------------------------------------------------------
@@ -329,7 +959,9 @@ Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unli
Given below are instructions to test the app manually.
-
:information_source: **Note:** These instructions only provide a starting point for testers to work on;
+
+
+:information_source: **Note:** These instructions only provide a starting point for testers to work on;
testers are expected to do more *exploratory* testing.
@@ -338,40 +970,89 @@ testers are expected to do more *exploratory* testing.
1. Initial launch
- 1. Download the jar file and copy into an empty folder
+ 1. Download the jar file and copy into an empty folder
- 1. Double-click the jar file Expected: Shows the GUI with a set of sample contacts. The window size may not be optimum.
+ 2. Double-click the jar file.
+ * Expected: Shows the GUI with a set of sample contacts. The window size may not be
+ optimum.
1. Saving window preferences
- 1. Resize the window to an optimum size. Move the window to a different location. Close the window.
+ 1. Resize the window to an optimum size. Move the window to a different location. Close the window.
- 1. Re-launch the app by double-clicking the jar file.
+ 1. Re-launch the app by double-clicking the jar file.
Expected: The most recent window size and location is retained.
-1. _{ more test cases … }_
+### Deleting a buyer
-### Deleting a person
+1. Deleting a buyer while all buyers are being shown
-1. Deleting a person while all persons are being shown
+ 1. Prerequisites: List all buyers using the `list buyer` command. Multiple buyers in the list.
- 1. Prerequisites: List all persons using the `list` command. Multiple persons in the list.
+ 2. Test case: `delete-b 1`
+ Expected: First buyer is deleted from the list. Details of the deleted contact shown in the message in the result display box.
- 1. Test case: `delete 1`
- Expected: First contact is deleted from the list. Details of the deleted contact shown in the status message. Timestamp in the status bar is updated.
+ 3. Test case: `delete-b 0`
+ Expected: No person is deleted. Error details shown in the message in the result display box.
- 1. Test case: `delete 0`
- Expected: No person is deleted. Error details shown in the status message. Status bar remains the same.
+ 4. Other incorrect delete commands to try: `delete`, `delete-b x`, `...` (where x is larger than the list size)
+ Expected: Similar to previous.
- 1. Other incorrect delete commands to try: `delete`, `delete x`, `...` (where x is larger than the list size)
- Expected: Similar to previous.
+### Matching a pet to an order
-1. _{ more test cases … }_
+1. Matching a pet with the exact same attributes as the order's requests
+ 1. Change the display list to be the buyer list by using `list buyer`.
+ 2. Add a new order by using this command `add-o 1 o_st/Pending o_r/add-r o_a/1 o_sp/Shiba Inu o_c/White o_cp/None o_pr/600, 1000 o_d/2022-10-20`.
+ 3. Change the display list to be the supplier list by using `list supplier`.
+ 4. Add a new pet by using this command `add-p 1 p_n/Kuro p_d/2021-11-10 p_c/White p_cp/None p_h/50 p_w/20 p_s/Shiba Inu p_v/true p_p/700`.
+ 5. Add another pet using this command `add-p 1 p_n/Aki p_d/2021-11-10 p_c/Black p_cp/None p_h/50 p_w/20 p_s/Shiba Inu p_v/true p_p/700`.
+ 6. Use the list command `list order` to view all orders and get the index of the order you have just added, it should be at the bottom of the order list.
+ 7. Next, use `match INDEX_OF_ORDER`, where the `INDEX_OF_ORDER` is the index of the order you have just added.
+ Expected: The display list should show that `Kuro` at the top of the pets list and `Aki` ranked below `Kuro`.
### Saving data
1. Dealing with missing/corrupted data files
- 1. _{explain how to simulate a missing/corrupted file, and the expected behavior}_
-
-1. _{ more test cases … }_
+ 1. Delete the `addressbook.json` file to simulate missing date file. Launch the application.
+ Expected: A new `addressbook.json` file is created with some sample data.
+
+2. Dealing with invalid data in data file
+
+ 1. Open the `addressbok.json` file. Change one of the fields to an invalid data, e.g change one of the `personCategory`
+ fields under the `buyers` to be `invalid`. Launch the application.
+ Expected: Application starts up with no sample data.
+
+## **Appendix: Effort**
+Our group feels that we have put in **much more effort** than what was required for this project. We faced several difficulties
+in maintaining several entity types. Due to the nature of our product, we had to handle five different entities - `Buyer`,
+`Supplier`, `Deliverer`, `Order` and `Pet`. Each entity also contains several attributes which makes it even more difficult
+to manage. Moreover, we had to account for how these entities and their attributes are displayed to the user in the `MainWindow` of our application.
+This led to a lot of issues with the UI as we had to ensure that the logic of each command and the information displayed to the users
+are coherent.
+
+Due to the existence of five entities, we also had to extend the commands for each of these entities. For instance, we could no
+longer have just one `AddPersonCommand` but had to extend the add command to be `AddBuyerCommand`, `AddSupplierCommand`,
+`AddDelivererCommand`, `AddOrderCommand` and `AddPetCommand`. The same goes for several other commands such as the `DeleteCommand`,
+`EditCommand`, `ListCommand` etc. On top of the fundamental commands, we have also implemented a few other commands such as the
+`MatchCommand`, `SortCommand` and `FilterCommand` to address the needs of our target user.
+
+Furthermore, since we wanted a smooth user experience for our product, we came up with a `AddCommandWithPopup` feature
+where users can add a `Buyer` and `Supplier` contact along with their respective `Order` and `Pet` using a popup window
+instead of the command box. This is to reduce the user's frustration in handling multiple prefixes when adding these contacts.
+However, to make it appeal more to CLI users, we also implemented shortcut keys in this feature so that users can simply
+use their keyboard to fill in contact details and item details.
+
+The addition of all these classes demanded a lot of refactoring to the code base of AB3. For instance, we had to update
+the `Storage` component to store all of these entities in a json-readable format. Furthermore, we had to design many testcases
+to ensure that our code was working how we wanted it to. All of these refactoring took a lot of time, effort and teamwork to accomplish.
+
+Lastly, we spent a lot of time updating and proofreading the User Guide and Developer Guide to ensure that our users and
+future developers would understand how our product works. There was a lot of changes made to the User Guide and Developer
+Guide due to the addition of many new entities and commands.
+
+Overall, as our team is dedicated to making our product address the needs of our users and improving the user experience
+when using our product, we have spent **a lot of time and effort** on this project. We have built upon the original AB3
+code base by leaps and bounds (as evident by the number of lines of code written by our team ~30 kLoC). We sincerely wish
+that our users would find our product addresses their needs and that future developers would be interested in contributing
+to our product.
diff --git a/docs/SettingUp.md b/docs/SettingUp.md
index 275445bd551..6f4668b2e5e 100644
--- a/docs/SettingUp.md
+++ b/docs/SettingUp.md
@@ -3,8 +3,9 @@ layout: page
title: Setting up and getting started
---
-* Table of Contents
-{:toc}
+## Table of Contents
+* [Setting up the project in your computer](#setting-up-the-project-in-your-computer)
+* [Before writing code](#before-writing-code)
--------------------------------------------------------------------------------------------------------------------
@@ -45,7 +46,7 @@ If you plan to use Intellij IDEA (highly recommended):
1. **Learn the design**
- When you are ready to start coding, we recommend that you get some sense of the overall design by reading about [AddressBook’s architecture](DeveloperGuide.md#architecture).
+ When you are ready to start coding, we recommend that you get some sense of the overall design by reading about [PetCode’s architecture](DeveloperGuide.md#architecture).
1. **Do the tutorials**
These tutorials will help you get acquainted with the codebase.
diff --git a/docs/Testing.md b/docs/Testing.md
index 8a99e82438a..95954f41854 100644
--- a/docs/Testing.md
+++ b/docs/Testing.md
@@ -3,8 +3,9 @@ layout: page
title: Testing guide
---
-* Table of Contents
-{:toc}
+## Table of Contents
+* [Running tests](#running-tests)
+* [Types of tests](#types-of-tests)
--------------------------------------------------------------------------------------------------------------------
diff --git a/docs/UserGuide.md b/docs/UserGuide.md
index 3716f3ca8a4..7bf41d2e3ad 100644
--- a/docs/UserGuide.md
+++ b/docs/UserGuide.md
@@ -2,191 +2,1047 @@
layout: page
title: User Guide
---
+
+
PetCode User Guide
+Welcome to the PetCode user guide!
-AddressBook Level 3 (AB3) is a **desktop app for managing contacts, optimized for use via a Command Line Interface** (CLI) while still having the benefits of a Graphical User Interface (GUI). If you can type fast, AB3 can get your contact management tasks done faster than traditional GUI apps.
+PetCode is a desktop app that helps store and manage contact information for your pet sales coordination business.
+
-* Table of Contents
-{:toc}
+{:refdef: style="text-align: center;"}
+![PetCode Logo](images/PetCode Logo.png)
+{: refdef}
+
+#### Using this guide
+If this is the first time you are using this user guide, it is highly recommended for you to read the section on
+[Introducing PetCode](#introducing-petcode). Otherwise,
+
+* If you are setting up, please take a look at our [Quick Start guide](#quick-start).
+* If you are unsure of how to use PetCode, the [Command Summary](#command-summary) table is a good starting point.
+* If you are a developer and want to help out, please take a look at the [Developer Guide](DeveloperGuide.md).
+* For quick navigation in this guide, click the hyperlink at the end of each command to go back to the table of contents, and navigate to other sections of this guide from there.
+
+## Table of Contents
+- **[Introducing PetCode](#introducing-petcode)**
+ * [What is PetCode?](#what-is-petcode)
+ * [Glossary](#glossary)
+ * [How to interpret the display window](#how-to-interpret-the-display-window)
+- **[Quick Start](#quick-start)**
+- **[Commands](#commands)**
+ * [Viewing help](#viewing-help--help)
+ * [Listing contacts or items](#listing-contacts-or-items--list)
+ * [Checking which item belongs to which contact](#checking-which-item-belongs-to-which-contact--check)
+ * [Adding a contact or item](#adding-a-contact-or-item--add)
+ + [Adding a buyer](#adding-a-buyer--add-b)
+ + [Adding a deliverer](#adding-a-deliverer--add-d)
+ + [Adding a supplier](#adding-a-supplier--add-s)
+ + [Adding an order to a buyer](#adding-an-order-to-a-buyer--add-o)
+ + [Adding a pet to a supplier](#adding-a-pet-to-a-supplier--add-p)
+ + [Adding a contact with a popup window](#adding-a-contact-with-a-popup-window--add)
+ * [Matching pets to an order](#matching-pets-to-an-order--match)
+ * [Deleting a contact or item](#deleting-a-contact-or-item--delete)
+ * [Editing attributes of a contact](#editing-attributes-of-a-contact--edit)
+ * [Finding contact(s) using keywords](#finding-contacts-using-keywords--find)
+ + [Finding a buyer](#finding-a-buyer--find-b)
+ + [Finding a supplier](#finding-a-supplier--find-s)
+ + [Finding a deliverer](#finding-a-deliverer--find-d)
+ * [Filtering items by attributes](#filtering-items-by-attributes--filter)
+ + [Filtering orders](#filtering-orders--filter-o)
+ + [Filtering pets](#filtering-pets--filter-p)
+ * [Sorting contacts](#sorting-contacts-and-items--sort)
+ * [Clearing all contacts](#clearing-all-entries--clear)
+ * [Exiting the program](#exiting-the-program--exit)
+ * [Automation of information flow (future feature)](#automation-of-information-flow-coming-in-v20)
+- **[How data is stored](#how-data-is-stored)**
+ * [Saving contacts and items](#saving-the-data)
+ * [Editing the data file](#editing-the-data-file)
+ * [Archiving data files](#archiving-data-files-coming-in-v20)
+- **[FAQ](#faq)**
+- **[Summaries](#summaries)**
+ * [List of prefixes](#list-of-prefixes)
+ * [Command summary](#command-summary)
--------------------------------------------------------------------------------------------------------------------
+## Introducing PetCode
+
+Whether you're new to PetCode, or just want to learn more about the details -- this section has you covered.
+This section will provide an overview of PetCode and explain key terms.
+
+### What is PetCode?
+
+PetCode is a free, open-source application designed for pet sales coordinators for contact information management.
+
+Due to the nature of a pet sales coordination business, you most likely have **a lot of information you need to deal with**.
+For example, what orders have you received? Which orders have not been fulfilled? How should you match this order with
+the pets available? What is the contact information of your pet buyers, pet suppliers and delivery services?
+
+PetCode is designed specifically to **improve your workflow**, by managing all this information to efficiently close
+deals and satisfy your customers. It can be used to offload information, categorise them more meaningfully, and match
+your customers' requests to their dream pet.
+
+### How to interpret the display window
+
+When you first run the app, you may see a display window pop up similar to the one below. We call this window the **Main Window**.
+![Starting Display Window](images/StartUIPage.png)
+
+The following diagram below shows how you should interpret this display window.
+* The **Command Box** refers to the text field where you can type commands in.
+* The **Display List for Contacts / Items** refers to the list of contacts / items you are currently displaying.
+ You may enter the following commands in the Command Box to see how the Display List changes:
+ * `list buyer` lists all buyers.
+ * `delete-b 1` deletes the buyer with index 1.
+ * `list order` lists all orders.
+ ![Interpreted Display Window](images/InterpretGUI.png)
+
+### Glossary
+
+In the user guide, you may come across some terms you do not understand. The following table provides clarification
+of the terms commonly used in PetCode.
+
+| Term | Description |
+|:----------------:|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| **Alphanumeric** | Digits and letters only. For example, `AB3`, `PetCode`, `coco123`, and `2103` are alphanumeric. `#01-04`, `email@domain.com`, and `white spaces` are not. |
+| **Attribute** | Words that follow prefixes to describe properties, states, characteristics, and traits. Examples are price, weight, name, and order status. |
+| **Command** | A command is a specific instruction you can give to PetCode to perform an action. You can view the list of commands available [here](#command-summary). |
+| **Contact** | A contact is an information entry in PetCode. There are three types of contacts you can add - `Buyer`, `Supplier` and `Deliverer`. You can add a contact with the [`add` command](#adding-a-contact-or-item-add). |
+| **CLI** | Command-Line Interface (CLI) receives commands from a user in the form of lines of text. It refers to the input textbox in this context. |
+| **GUI** | GUI stands for Graphical User Interface. It refers to the display window of the PetCode application. |
+| **Index** | The index of the contact or item in the display list for contacts/items. |
+| **Integer** | Whole number |
+| **Item** | An item refers to an `Order` or a `Pet`. An Order refers to the order placed by a buyer. A Pet refers to the pet available for sale. |
+| **Parameter** | A parameter refers to the information you need to give to your command such that it can execute an action based on that information. For example, the [`list` command](#listing-contacts-or-items--list) requires a KEY parameter to know what kind of list to display. `list buyer` displays your list of buyers, where the KEY parameter is `buyer`. |
+| **Prefix** | A prefix indicates the kind of information you are keying in. You can view the list of prefixes available [here](#list-of-prefixes). |
+| **Whitespace** | An empty character, or a placeholder character ` `. |
+
## Quick start
-1. Ensure you have Java `11` or above installed in your Computer.
+1. Ensure you have Java `11` or above installed in your Computer. Please kindly refer
+ [here](https://blog.hubspot.com/website/check-java-verison) for further instructions on how to do so.
-1. Download the latest `addressbook.jar` from [here](https://github.com/se-edu/addressbook-level3/releases).
+2. Download the latest `petcode.jar` from [here](https://github.com/AY2223S1-CS2103T-T09-2/tp/releases).
-1. Copy the file to the folder you want to use as the _home folder_ for your AddressBook.
+3. Copy the file to the folder you want to use as the _home folder_ for your PetCode app.
-1. Double-click the file to start the app. The GUI similar to the below should appear in a few seconds. Note how the app contains some sample data.
+4. Double-click the file to start the app. The GUI similar to the below should appear in a few seconds. Note that the app
+ contains some sample data and the pet images are unchangeable in the current version of PetCode. Clicking the hyperlinks under the pet image will just open your browser and does nothing more.
![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.
+5. 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.
Some example commands you can try:
- * **`list`** : Lists all contacts.
+ * **`list buyer`** : Lists all buyers.
- * **`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-b n/Hongyi ph/11223344 e/email@u.nus.edu a/UTR 138600 l/Singapore`** : Adds
+ a pet buyer named `Hongyi` to the PetCode.
- * **`delete`**`3` : Deletes the 3rd contact shown in the current list.
+ * **`delete-b 1`** : Deletes the first contact from the buyer contacts list.
- * **`clear`** : Deletes all contacts.
+ * **`clear`** : Deletes all contacts. You can use this command to clear all the sample data provided. Be extra careful when using this command since **there is no `undo`**.
- * **`exit`** : Exits the app.
+ * **`exit`** : Exits the app.
-1. Refer to the [Features](#features) below for details of each command.
+6. Refer to the [Commands](#commands) Section below for details of each command.
+
+[Go back to [Table of Contents](#table-of-contents)]
--------------------------------------------------------------------------------------------------------------------
-## Features
+## Commands
-**:information_source: Notes about the command format:**
+:information_source: **How to interpret the Command format:**
-* Words in `UPPER_CASE` are the parameters to be supplied by the user.
+* Words in `UPPER_CASE` are the parameters to be supplied by you.
e.g. in `add n/NAME`, `NAME` is a parameter which can be used as `add n/John Doe`.
* Items in square brackets are optional.
- e.g `n/NAME [t/TAG]` can be used as `n/John Doe t/friend` or as `n/John Doe`.
+ e.g. `p_n/PET_NAME [p_cert/CERTIFICATE]` can be used as `p_n/Page p_cert/USA Bureau of Exportation Certified` or as `p_n/Page`.
* Items with `…` after them can be used multiple times including zero times.
- e.g. `[t/TAG]…` can be used as ` ` (i.e. 0 times), `t/friend`, `t/friend t/family` etc.
-
-* Parameters can be in any order.
- e.g. if the command specifies `n/NAME p/PHONE_NUMBER`, `p/PHONE_NUMBER n/NAME` is also acceptable.
+ e.g. `[p_cert/CERTIFICATE]…` can be used as ` ` (i.e. 0 times), `p_cert/noble blood`, `p_cert/noble blood p_cert/house-trained` etc.
-* If a parameter is expected only once in the command but you specified it multiple times, only the last occurrence of the parameter will be taken.
- e.g. if you specify `p/12341234 p/56785678`, only `p/56785678` will be taken.
+* If a parameter is expected only once in the command, but you specified it multiple times, only the last occurrence of
+ the parameter will be taken.
+ e.g. if you specify `ph/12341234 ph/56785678`, only `ph/56785678` will be taken.
-* Extraneous parameters for commands that do not take in parameters (such as `help`, `list`, `exit` and `clear`) will be ignored.
+* Extraneous parameters for commands that do not take in parameters (such as `help`, `exit` and `clear`) will be
+ ignored.
e.g. if the command specifies `help 123`, it will be interpreted as `help`.
+* If the command format contains round brackets `()`, it means the command format inside `()` is omitted and can be found in another command.
+ e.g. in `add-b n/NAME ph/PHONE_NUMBER e/EMAIL a/ADDRESS l/LOCATION o/add-o(order1 prefixes and parameters)…`, the detailed command format inside `()` is omitted and can be found in [Adding an order to a buyer](#adding-an-order-to-a-buyer--add-o).
+
+* Unless otherwise specified, the order of prefixes does not matter.
+ e.g. if the command specifies `n/NAME ph/PHONE_NUMBER`, `ph/PHONE_NUMBER n/NAME` is also acceptable, unless stated otherwise in a particular command.
+
+
+[Go back to [Table of Contents](#table-of-contents)]
+
### Viewing help : `help`
-Shows a message explaning how to access the help page.
+Shows a message explaining how to access the help page.
-![help message](images/helpMessage.png)
+![help message](images/helpWindow.png)
Format: `help`
+[Go back to [Table of Contents](#table-of-contents)]
+[Go back to [Commands](#commands)]
+
+### Listing contacts or items : `list`
+
+Displays the specified type of contacts or items. This command is especially useful when you want to view all contacts or items of the same type,
+or when you want to set the display list to the correct list as required by other commands.
+
+Format: `list KEY`
+
+#### KEY Table
+
+| Contact / Item to List | KEY |
+|:----------------------:|:------------:|
+| Buyer | buyer, b |
+| Supplier | supplier, s |
+| Deliverer | deliverer, d |
+| Order | order, o |
+| Pet | pet, p |
+| All Person | all, a |
+
+
+Examples:
+* `list buyer` or `list b`, lists all Buyer contacts with their orders.
+* `list deliverer` or `list d`, lists all Deliverer contacts.
+* `list supplier` or `list s`, lists all Supplier contacts with their pets.
+* `list all` or `list a`, lists all Buyer, Deliverer, Supplier contacts and their respective pets and orders details.
+* `list order` or `list o`, lists all Orders.
+* `list pet` or `list p`, lists all Pets.
+
+[Go back to [Table of Contents](#table-of-contents)]
+[Go back to [Commands](#commands)]
+
+### Checking which item belongs to which contact : `check`
+
+Checks a contact at the specified index and shows his/her items, or checks an item at the specified index and shows the contact it belongs to.
+This command is especially useful when you want to switch the display between related buyers and orders, or switch the display between related suppliers and pets.
+
+Format: `check KEY INDEX`
+
+#### KEY Table
+
+| Contact / Item to Check | KEY |
+|:-----------------------:|:------------:|
+| Buyer | buyer, b |
+| Supplier | supplier, s |
+| Order | order, o |
+| Pet | pet, p |
+
+#### Expected Behaviour for each type of the Check command
+
+| Examples | Expected behaviour |
+|-----------------|-------------------------------------------------------------------------------------------|
+| `check buyer 1` | Shows the list of orders from the buyer at index 1, if at index 1 is a buyer. |
+| `check s 2` | Shows the list of pets on sale from the supplier at index 2, if at index 2 is a supplier. |
+| `check order 3` | Shows the buyer of the order at index 3, if at index 3 is an order. |
+| `check p 4` | Shows the supplier of the pet at index 4, if at index 4 is a pet. |
+
+
+
+:exclamation: **Caution:** For the current version of PetCode, `check deliverer INDEX` will just display an empty list, since adding orders to deliverers is not yet implemented.
+In the future, you may be able to transfer orders from buyers to deliverers and check out the deliverers' orders.
+
+
+
+[Go back to [Table of Contents](#table-of-contents)]
+[Go back to [Commands](#commands)]
+
+### Adding a contact or item : `add`
+
+Adds a contact or item to the address book.
+
+* A contact can be of three categories: Buyer, Deliverer, and Supplier.
+* An item can be either an Order or Pet.
+
+General Format for add command: `add-KEY prefix/PARAMETERS…`, where:
+
+* `KEY` specifies what type of contact or item you want to add.
+* `prefix` indicates the kind of information you are adding.
+* `PARAMETER` is the content of the information you are adding.
+
+Kindly refer to the [Summaries](#summaries) section for more information on the available prefixes and a summarised list
+of add commands.
+
+
+
+:bulb: **Tip:** If you are a beginner, we highly recommend you to use
+the [Add Command using the popup window](#adding-a-contact-with-a-popup-window--add)
+instead of the usual CLI interface.
+
+
+
+[Go back to [Table of Contents](#table-of-contents)]
+[Go back to [Commands](#commands)]
+
+#### Adding a buyer : `add-b`
+
+Adds a buyer to the contact list. A buyer is a person who would like to buy pet(s) and places one or more orders describing what kind
+of pet(s) he/she would like.
+
+You can add a buyer without orders as shown below.
+
+Format: `add-b n/NAME ph/PHONE_NUMBER e/EMAIL a/ADDRESS l/LOCATION`
+
+Example:
+* To add a single buyer: `add-b n/Hongyi ph/11223344 e/email@u.nus.edu a/UTR 138600 l/Singapore`
+
+
+
+:information_source: **What is the difference between address and location?**
+
+ * **Address** is the specific street number and unit number of the place.
+ * **Location** is the country this person is based.
+
+Since PetCode caters to international pet sale, it is good to have location as a separate attribute.
+Different countries have different regulations on pet sale, and you may need to filter persons by their locations for some reason.
+
+
+
+What if the buyer that you want to add already has some orders?
+**You can add a buyer and his/her orders in one shot!** Check it out below :point_down:
+Format: `add-b n/NAME ph/PHONE_NUMBER e/EMAIL a/ADDRESS l/LOCATION o/add-o(order1 prefixes and parameters) o/add-o(order2 prefixes and parameters)…`
+
+
+
+:bulb: **Tip:** You can input as many `o/add-o` prefixes as you need. Each `o/add-o` creates an order under the buyer.
+After each `o/add-o`, simply enter the details of the order without specifying the index of the associated buyer.
+Don't know how to add an order properly? Refer to [Add Order](#adding-an-order-to-a-buyer--add-o) for more information.
+
+
+
+
+
+:bulb: **Tip:** For more details on what each prefix represents, kindly refer to [List of Prefixes](#list-of-prefixes).
+
+
+
+Examples:
+* To add a buyer with one
+ order: `add-b n/Hongyi ph/11223344 e/hhygg@u.nus.edu a/UTR 138600 l/Singapore o/add-o o_st/Pending o_r/add-r o_a/1 o_sp/Siamese cat o_c/black o_cp/black and brown o_p/30 o_pr/20, 50 o_d/2022-10-26 o_ar/vaccinated o_ar/free delivery`
+* To add a buyer with two
+ orders: `add-b n/Hongyi ph/11223344 e/hhygg@u.nus.edu a/UTR 138600 l/Singapore o/add-o o_st/Pending o_r/add-r o_a/1 o_sp/Siamese cat o_c/black o_cp/black and brown o_p/30 o_pr/20, 50 o_d/2022-10-26 o_ar/vaccinated o_ar/free delivery o/add-o o_st/Negotiating o_r/add-r o_a/3 o_sp/Shih Tzu o_c/white o_cp/dotted white o_p/44.1 o_pr/10.6, -1 o_d/2022-09-20 o_ar/noble blood o_ar/not naughty`
+
+
+
+
+:exclamation: **Caution**: Take note that the above added buyers are considered as the SAME, so if you try all these sample commands, PetCode will notify you that the buyer already exists in the list.
+Check out [FAQ](#faq) on the concept of "How contacts and items are considered as duplicates".
+
+
+
+
+
+
+:bulb: **Tip:** **Overwhelmed by the prefixes** when adding multiple orders?
+Check out [Add Command using the popup window](#adding-a-contact-with-a-popup-window--add) to add multiple orders when adding a buyer **without prefixes**.
+
+
+
+To help you better understand the hierarchy of the second sample command, we illustrate its structure as follows:
+
+
+
+[Go back to [Table of Contents](#table-of-contents)]
+[Go back to [Commands](#commands)]
+
+#### Adding a deliverer : `add-d`
+
+Adds a deliverer to your contact list. A deliverer delivers pets from suppliers to buyers.
+
+Format: `add-d n/NAME ph/PHONE_NUMBER e/EMAIL a/ADDRESS l/LOCATION`
+
+Examples:
+
+* To add a single deliverer: `add-d n/Lezheng ph/19657471 e/lez998@u.nus.edu a/PGP Residences 118429 l/Singapore`
+
+[Go back to [Table of Contents](#table-of-contents)]
+[Go back to [Commands](#commands)]
+
+#### Adding a supplier : `add-s`
+
+Adds a supplier to the contact list. A supplier feeds, trains, and takes care of pets for sale.
+
+You can add a supplier without pets as shown below.
+
+Format: `add-s n/NAME ph/PHONE_NUMBER e/EMAIL a/ADDRESS l/LOCATION`
+
+Example:
+* To add a single supplier: `add-s n/Carol Pet House ph/11223344 e/carolpethouse@gmail.com a/Marina Bay Sands 138600 l/USA`
+
+Similar to the [Add Buyer](#adding-a-buyer-add-b) command, you may feel the need to add a supplier together with all the pets he/she sells in one shot.
+Check it out below :point_down:
+
+Format: `add-s n/NAME ph/PHONE_NUMBER e/EMAIL a/ADDRESS l/LOCATION p/add-p(pet1 prefixeds and parameters) p/add-p(pet2 prefixeds and parameters)…`
+
+
+
+:bulb: **Tip:** Note that you can input as many `p/add-p` prefixes as you need. Each `p/add-p` creates an order under the buyer.
+After each `p/add-p`, simply enter the details for the pet without specifying the index of the associated supplier.
+Don't know how to add a pet properly? Refer to [Add Pet](#adding-a-pet-to-a-supplier--add-p) for more information.
+
+
+
+
+
+:bulb: **Tip:** For more details on what each prefix represents, kindly refer to [List of Prefixes](#list-of-prefixes).
+
+
+
+Examples:
+* To add a supplier with one pet for
+ sale: `add-s n/Carol Pet House ph/17238965 e/carolpethouse@gmail.com a/Marina Bay Sands 138600 l/Singapore p/add-p p_n/Luck p_d/2022-01-01 p_c/pink p_cp/pure pink p_h/41.2 p_s/Yorkshire pig p_cert/US certified p_v/true p_w/102.5 p_p/270.3`
+* To add a supplier with two pets for
+ sale: `add-s n/Carol Pet House ph/17238965 e/carolpethouse@gmail.com a/Marina Bay Sands 138600 l/Singapore p/add-p p_n/Luck p_d/2022-01-01 p_c/pink p_cp/pure pink p_h/41.2 p_s/Yorkshire pig p_cert/US certified p_v/true p_w/102.5 p_p/270.3 p/add-p p_n/Snupy p_d/2021-05-31 p_c/white p_cp/dotted p_h/89.3 p_cert/US certified p_s/Californian rabbit p_v/false p_w/32.8 p_p/330.3`
+
+
+
+:exclamation: **Caution**: Take note that the above added suppliers are considered as the SAME, so if you try all these sample commands, PetCode will notify you that the supplier already exists in the list.
+Check out [FAQ](#faq) on the concept of "What is being the same".
+
+
+
+
+
+:bulb: **Tip:** **Overwhelmed by the prefixes** when adding multiple pets?
+Check out [Add Command using the popup window](#adding-a-contact-with-a-popup-window--add) to add multiple pets when adding a supplier **without prefixes**.
+
+
+
+To help you better understand the hierarchy of the second sample command, we illustrate its structure as follows:
+
+
+
+[Go back to [Table of Contents](#table-of-contents)]
+[Go back to [Commands](#commands)]
+
+#### Adding an order to a buyer : `add-o`
+
+Adds an order to a buyer contact. This is especially useful when an existing buyer has a new order, or when the buyer confirms the order some time after being added to the contacts.
+
+Format: `add-o INDEX_OF_BUYER o_st/STATUS o_r/add-r o_a/AGE o_sp/SPECIES o_c/COLOR o_cp/COLOR_PATTERN o_p/PRICE o_pr/PRICE_RANGE o_d/DATE [o_ar/ADDITIONAL_REQUEST]…`
+
+
+
+:exclamation: **Caution**: `INDEX_OF_BUYER` should be immediately after `add-o`.
+Ensure that at the index is a buyer before executing this command,
+which can be achieved by executing the [List Command](#listing-contacts-or-items--list) or [Find buyer command](#finding-a-buyer--find-b) beforehand.
+
+
+
+
+:exclamation: **Caution**: Please ensure that `o_r/` is followed by `add-r` immediately and there are no other prefixes
+between `o_r/`, `o_a/`, `o_c/`, `o_cp/`, and `o_sp/`. This is because they as a whole specify how the requested pet
+should be like.
+
+
+
+
+
+:information_source: **What is a request in an order?**
+
+The prefix `o_r/` specifies a request, which contains the **characteristics of a pet** that the buyer wants the pet to have,
+including age, color, color pattern and species.
+Other information in the order that is **not directly related to a pet**, such as the order status and the price range the buyer is willing to accept, **does not fall under request**.
+
+
+
+
+
+:bulb: **Tip:** For more details on what each prefix represents, kindly refer to [List of Prefixes](#list-of-prefixes).
+
+
+
+Examples:
+
+* To add an order to the buyer at index 1 of the display list: `add-o 1 o_st/Pending o_r/add-r o_a/1 o_sp/German shepherd o_c/golden o_cp/pure color o_p/30 o_pr/20, 50 o_d/2022-10-26 o_ar/vaccinated o_ar/free delivery`
+* To add an order to the buyer at index 2 of the display list: `add-o 2 o_st/Negotiating o_r/add-r o_a/3 o_sp/chihuahua o_c/white o_cp/dotted white o_p/44.1 o_pr/10.6, -1 o_d/2022-09-20 o_ar/noble blood o_ar/not naughty`
+
+[Go back to [Table of Contents](#table-of-contents)]
+[Go back to [Commands](#commands)]
+
+#### Adding a pet to a supplier : `add-p`
+
+Adds a pet to a supplier contact. This is especially useful when an existing supplier has a new pet for sale or when the supplier tells you what are the pets he/she owns some time after being added to the contacts.
+
+Format: `add-p INDEX_OF_SUPPLIER p_n/PET_NAME p_d/DATE_OF_BIRTH p_c/COLOR p_cp/COLOR_PATTERN p_h/HEIGHT p_w/WEIGHT p_s/SPECIES p_v/VACCINATION_STATUS p_p/PRICE [p_cert/CERTIFICATE]…`
+
+
+
+:exclamation: **Caution**: `INDEX_OF_SUPPLIER` should be immediately after `add-p`.
+Ensure that at the index is a supplier before executing this command,
+which can be achieving by executing the [List Command](#listing-contacts-or-items--list) or [Find supplier command](#finding-a-supplier--find-s) beforehand.
+
+
+
+Examples:
+
+* To add a pet to the supplier at index 1 of the display list: `add-p 1 p_n/Kawaii p_d/2001-11-20 p_c/red p_cp/stripped p_h/39.5 p_s/Bengal cat p_v/true p_w/15.3 p_p/20 p_cert/GoodDog Cert p_cert/Royal Blood Cert`
+
+
+
+:bulb: **Tip:** For more details on what each prefix represents, kindly refer to [List of Prefixes](#list-of-prefixes).
+
+
+
+[Go back to [Table of Contents](#table-of-contents)]
+[Go back to [Commands](#commands)]
+
+#### Adding a contact with a popup window : `add`
-### Adding a person: `add`
+Adds a contact with a popup window that has prompt texts for what to input without the need to enter any
+prefixes. This reduces the need to memorise prefixes.
+Given below is the popup window for adding a supplier.
-Adds a person to the address book.
+![pop up window for adding a supplier](images/AddSupplierWithPopup.png)
-Format: `add n/NAME p/PHONE_NUMBER e/EMAIL a/ADDRESS [t/TAG]…`
+The followings are two ways to use this command:
+
+* Adds a buyer to the contacts with or without any number of orders.
+
+ Format: `add buyer`
+
+* Adds a supplier to the contacts with or without any number of pets.
+
+ Format: `add supplier`
+
+
+
+**:bulb: Tip:** **Useful keyboard shortcuts for the pop-up window:**
+
+| Keyboard shortcut | Associated action |
+|:-----------------:|:---------------------------------------------------------------------------------------|
+| ESCAPE | Closes the popup window **without saving** |
+| ENTER | Goes to the next input text field |
+| CTRL + A | Adds an order/pet to the buyer/supplier |
+| CTRL + D | Deletes the last order/pet under the buyer/supplier in the popup window |
+| CTRL + S | Saves the inputs, adds the buyer/supplier to the contacts, and closes the popup window |
+| CTRL + D | Deletes the last order/pet under the buyer/supplier in the pop-up window |
+| CTRL + S | Saves the inputs, adds the buyer/supplier to the contacts, and closes the pop-p window |
+
+Note that some shortcuts are only **effective when a text field is in focus**.
+When no text fields are highlighted (i.e. not in focus), **press TAB once (still no focus, press TAB again and again until the highlight appears)** to focus the cursor to a text field.
+This ensures that you can use all the available shortcuts.
+
+
+
+
+
+:information_source: **Note**: If a compulsory text field is ***empty*** or a text field ***starts with whitespace*** during saving, the cursor will be brought to that text field,
+which will be highlighted in red.
+
+
+
+
+
+:information_source: **Note**: If the input of a text field is in the ***wrong format*** during saving, the person will not be added to
+the contacts and the pop-up window will not close.
+The error message and the correct format of the input will be shown in the **main window**.
+
+
+
+
+
+:exclamation: **Caution**: This command is only available for **adding a buyer or supplier** for the current version.
+Note that the three buttons for adding pets to a supplier, which are `Upload photo`, `Upload pet certificate`, `Upload vaccination proof` (as seen in the image above),
+only **open the file explorer** and **do nothing more**. You may be able to upload files from your local disk to the storage of PetCode in future versions.
+
+
+
+[Go back to [Table of Contents](#table-of-contents)]
+[Go back to [Commands](#commands)]
+
+### Matching pets to an order : `match`
+
+Matches the "best fit" pet to an order. This is especially useful when you receive an order
+and want to find out **which pet(s)** on sale is the **best fit** (i.e. description of the pet matches as many requirements specified in the order as possible).
+With this information, you may contact the suppliers who own these pets for further negotiation.
+
+
+
+:information_source: **How does the match command work?**
+
+We have designed an algorithm to give each pet in the storage a score. Pets with descriptions that are closer to the requirements specified in the order will be given a higher score.
+Pets with higher scores (i.e. more fitting to the order) are displayed on top. If you want to know how we design the algorithm, check out our [Developer Guide](DeveloperGuide.md).
+
+In the current version of PetCode, the score calculation in the algorithm uses a default set of weightages. In the future, you may be able to define your own
+weightages for different parameters, such as price, age, species and so on.
+
+
+
+Format: `match INDEX`
+
+Example:
+* To match the first order in the display list to pets in the storage: `match 1`
+
+
+
+:exclamation: **Caution**: Please ensure that at the index is an order, which can be achieved by executing the [List command](#listing-contacts-or-items--list) or [Filter order command](#filtering-orders--filter-o) beforehand.
+
+
+
+Using the original set of sample data **without any modification**, the following picture shows the display list before the
+match command is executed. The original order is `Shiro`, `Ashy`, `Plum`, `Page`, `Snowy`, and `Buddy`.
+
+![before match command](images/BeforeMatch.png)
+
+The following picture shows the display list after `match 1` is executed. Now the order is `Snowy`, `Page`, `Plum`
+, `Ashy`, `Shiro`, and `Buddy`.
+
+![after match command](images/AfterMatch.png)
+
+[Go back to [Table of Contents](#table-of-contents)]
+[Go back to [Commands](#commands)]
+
+### Deleting a contact or item : `delete`
+
+Deletes a contact / item at the specified index of the respective contact / item list.
+
+Format: `delete-KEY INDEX`
+
+#### KEY Table
+
+| Contact / Item to Delete | KEY |
+|:------------------------:|:---:|
+| Buyer | b |
+| Supplier | s |
+| Deliverer | d |
+| Order | o |
+| Pet | p |
+
+Examples:
+* `delete-b 1`, deletes `Buyer` contact at index 1 of the display list, if index is found.
+* `delete-s 2`, deletes `Supplier` contact at index 2 of the display list, if index is found.
+* `delete-d 1`, deletes `Deliverer` contact at index 1 of the display list, if index is found.
+* `delete-o 1`, deletes `Order` at index 1 of the display list, if index is found.
+* `delete-p 1`, deletes `Pet` at index 1 of the display list, if index is found.
+
+
+
+:exclamation: **Caution**: Please ensure that you have the corresponding display list before you execute the delete command.
+For example, if you want to delete a buyer by `delete-b 1`, do ensure at index 1 is a buyer.
+This is to make sure you know what you are deleting and do not delete a contact or item by accident, since there is no `undo` command yet.
+
+ * To ensure at the index is a contact, use [List command](#listing-contacts-or-items--list) or [Find command](#finding-contacts-using-keywords--find).
+ * To ensure at the index is an item, use [List command](#listing-contacts-or-items--list) or [Filter command](#filtering-items-by-attributes--filter).
+
+
+
+
+
+**:bulb: Tip:** Want to delete an order or a pet when browsing through the list of buyer / supplier?
+You **don't need to** list all orders / pets, find that particular order / pet and its index, and delete from there.
+Instead, you can just use the [Check command](#checking-which-item-belongs-to-which-contact--check), `check buyer 1` for example, and delete from the order list of that buyer.
+
+
+
+[Go back to [Table of Contents](#table-of-contents)]
+[Go back to [Commands](#commands)]
+
+### Editing attribute(s) of a contact : `edit`
+
+Edits one or more attributes of a contact by the index number used in the displayed contacts list.
+Existing values of that attribute will be overwritten by the input values.
+Please provide **at least one** attribute.
+
+Format: `edit-KEY INDEX [n/NAME] [ph/PHONE_NUMBER] [e/EMAIL] [a/ADDRESS] [l/LOCATION]`
+
+#### KEY Table
+
+| Contact to Edit | Role |
+|:---------------:|:----:|
+| Buyer | b |
+| Deliverer | d |
+| Supplier | s |
+
+
+
+:exclamation: **Caution**: Please ensure that you have the corresponding display list before you execute the edit command.
+For example, if you want to edit a buyer by `edit-b 1`, do ensure at index 1 is a buyer.
+
+
+
+Examples:
+* `edit-b 1 n/Alex`, modifies the name of the Buyer contact at index 1 of Buyer List to Alex, if index is found.
+* `edit-s 3 n/Bobby ph/884321` modifies the name to Bobby and phone to 884321, of the Supplier contact at index 3 of Supplier List to Alex, if index is found.
+
+
+
+:exclamation: This command is only available for **editing the basic information** of a contact for the current version. In other words, **information regarding `Order`/`Pet`** that the `Buyer`/`Supplier` possess **cannot be modified**.
+
+
+
+[Go back to [Table of Contents](#table-of-contents)]
+[Go back to [Commands](#commands)]
+
+### Finding contact(s) using keywords : `find`
+
+Displays **all** contacts which match **one** specific attribute. This command is especially useful when you want to quickly
+find contacts based on an attribute.
+
+Format: `find PREFIX/ATTRIBUTE`
+
+There are five possible attributes for finding contact(s):
+address, email, location, name, phone. Please provide **one** out of the five when using this command.
+
+#### Attributes and Their Corresponding Prefixes Table
+
+| Attribute | Prefix | Format | Example |
+|-----------|--------|-----------|------------------------|
+| Address | a | a/KEYWORD | a/Wall Street |
+| Email | e | e/KEYWORD | e/whereisamy@gmail.com |
+| Location | l | l/KEYWORD | l/Nova Scotia |
+| Name | n | n/KEYWORD | n/Amy Toh |
+| Phone | ph | ph/NUMBER | ph/81234567 |
+
+Examples:
+
+* `find a/6th College Ave West`, looks for and displays (if any) any person who lives at this address.
+* `find e/blackball@furry.com`, looks for and displays (if any) any person who has this email address.
+* `find ph/98986668`, looks for and displays (if any) any person whose phone number is that.
+
+
+
+:information_source: **Notes**:
+
+ * Only **one** attribute is allowed. For example, `find a/6th College Ave West ph/98986668` and `find ph/98986668 ph/98986677` are not allowed.
+ * This command is case-insensitive, meaning `find a/Wall Street` is equivalent to `find a/wall street`.
+ * The above principles also apply to the sub-commands of `find` given below.
-
:bulb: **Tip:**
-A person can have any number of tags (including 0)
+[Go back to [Table of Contents](#table-of-contents)]
+[Go back to [Commands](#commands)]
+
+#### Finding a buyer : `find-b`
+
+Displays all buyers who match **one** specific attribute.
+
+Format: `find-b PREFIX/ATTRIBUTE`
+
+Check out the [Attributes and Their Corresponding Prefixes Table](#attributes-and-their-corresponding-prefixes-table)
+for more information on prefixes and attributes.
+
Examples:
-* `add n/John Doe p/98765432 e/johnd@example.com a/John street, block 123, #01-01`
-* `add n/Betsy Crowe t/friend e/betsycrowe@example.com a/Newgate Prison p/1234567 t/criminal`
-### Listing all persons : `list`
+* `find-b a/6th College Ave West`, looks for and displays any `Buyer` who lives at this address.
+* `find-b e/blackball@furry.com`, looks for and displays any `Buyer` who has this email address.
+* `find-b ph/98986668`, looks for and displays any `Buyer` whose phone number is that.
+
+[Go back to [Table of Contents](#table-of-contents)]
+[Go back to [Commands](#commands)]
+
+#### Finding a deliverer : `find-d`
+
+Displays all deliverers who match **one** specific attribute.
+
+Format: `find-d PREFIX/ATTRIBUTE`
+
+Check out the [Attributes and Their Corresponding Prefixes Table](#attributes-and-their-corresponding-prefixes-table)
+for more information on prefixes and attributes.
+
+Examples:
-Shows a list of all persons in the address book.
+* `find-d a/6th College Ave West`, looks for and displays any `Deliverer` who lives at this address.
+* `find-d e/blackball@furry.com`, looks for and displays any `Deliverer` who has this email address.
+* `find-d ph/98986668`, looks for and displays any `Deliverer` whose phone number is that.
-Format: `list`
+[Go back to [Table of Contents](#table-of-contents)]
+[Go back to [Commands](#commands)]
-### Editing a person : `edit`
+#### Finding a supplier : `find-s`
-Edits an existing person in the address book.
+Displays all suppliers who match **one** specific attribute.
-Format: `edit INDEX [n/NAME] [p/PHONE] [e/EMAIL] [a/ADDRESS] [t/TAG]…`
+Format: `find-s PREFIX/ATTRIBUTE`
-* Edits the person at the specified `INDEX`. The index refers to the index number shown in the displayed person list. The index **must be a positive integer** 1, 2, 3, …
-* At least one of the optional fields must be provided.
-* Existing values will be updated to the input values.
-* When editing tags, the existing tags of the person will be removed i.e adding of tags is not cumulative.
-* You can remove all the person’s tags by typing `t/` without
- specifying any tags after it.
+Check out the [Attributes and Their Corresponding Prefixes Table](#attributes-and-their-corresponding-prefixes-table)
+for more information on prefixes and attributes.
Examples:
-* `edit 1 p/91234567 e/johndoe@example.com` Edits the phone number and email address of the 1st person to be `91234567` and `johndoe@example.com` respectively.
-* `edit 2 n/Betsy Crower t/` Edits the name of the 2nd person to be `Betsy Crower` and clears all existing tags.
-### Locating persons by name: `find`
+* `find-s a/6th College Ave West`, looks for and displays any `Supplier` who lives at this address.
+* `find-s e/blackball@furry.com`, looks for and displays any `Supplier` who has this email address.
+* `find-s ph/98986668`, looks for and displays any `Supplier` whose phone number is that.
+
+[Go back to [Table of Contents](#table-of-contents)]
+[Go back to [Commands](#commands)]
+
+### Filtering items by attributes : `filter`
+
+Displays items based on the specified attribute(s). This command is especially useful when you want to coordinate
+sales between a Buyer and Supplier, by filtering out orders that are still "Pending", or filtering out pets with specific attributes.
+Please provide **at least one** attribute when using this command.
+
+
+
+:information_source: **What is the difference between find command and filter command?**
+ * Find command: Finds **contact(s)**; only **one** attribute is allowed.
+ * Filter command: Filters **item(s)**; **multiple** attributes are allowed.
+
+
+
+
+
+:information_source: **Notes**:
+
+ * This command is case-insensitive, meaning `filter-o o_st/Pending` is equivalent to `filter-o o_st/pending`.
+ * Having multiple prefixes of the same type is allowed, but only the latest input will be taken.
+ For example, `filter-o o_st/Pending o_st/Delivering` is equivalent to `filter-o o_st/Delivering`.
+ * When multiple attributes are given, items that fulfil **all** attributes are filtered out.
+
+
+
+#### Filtering orders : `filter-o`
+
+Displays Orders that satisfy the given attribute(s). There are three possible attributes to filter: additional
+requests, order status, and price range.
+
+Format: `filter-o PREFIX/ATTRIBUTE [PREFIX/ATTRIBUTE]…`
+
+| Attribute | Prefix | Format | Example |
+|---------------------|--------|-------------------------------|--------------------|
+| Additional requests | o_ar | o_ar/KEYWORD | o_ar/free delivery |
+| Order Status | o_st | o_st/KEYWORD | o_st/Negotiating |
+| Price Range | o_pr | o_pr/LOWER_BOUND, UPPER_BOUND | o_pr/100, 456 |
+
+
+
+:exclamation: **Caution**: Order status can only be one of the following three: `Pending`, `Negotiating`, `Delivering`.
+
+
-Finds persons whose names contain any of the given keywords.
+
-Format: `find KEYWORD [MORE_KEYWORDS]`
+:information_source: Filtering based on price range will filter out orders with price ranges that are **subsets** of the price range specified by the user.
+For example, the user input `100, 200` will filter out orders with price ranges `100, 150` and `180, 200`, but not `80, 140` and `175, 230`.
-* The search is case-insensitive. e.g `hans` will match `Hans`
-* The order of the keywords does not matter. e.g. `Hans Bo` will match `Bo Hans`
-* Only the name is searched.
-* Only full words will be matched e.g. `Han` will not match `Hans`
-* Persons matching at least one keyword will be returned (i.e. `OR` search).
- e.g. `Hans Bo` will return `Hans Gruber`, `Bo Yang`
+
Examples:
-* `find John` returns `john` and `John Doe`
-* `find alex david` returns `Alex Yeoh`, `David Li`
- ![result for 'find alex david'](images/findAlexDavidResult.png)
-### Deleting a person : `delete`
+* `filter-o o_st/Pending`, filters out orders with order status set to `Pending`
+* `filter-o o_st/Negotiating o_pr/90, 900`, filters out orders with order status set to`Negotiating` and price ranges that are subsets of `90, 900`
+* `filter-o o_ar/good o_st/Delivering o_pr/80, 100`, filters out orders with additional requests that contain the keyword `good`, order status set to `Delivering` and price ranges that are subsets of `80, 100`.
+
+[Go back to [Table of Contents](#table-of-contents)]
+[Go back to [Commands](#commands)]
-Deletes the specified person from the address book.
+#### Filtering pets : `filter-p`
-Format: `delete INDEX`
+Displays Pets that satisfy the given attributes. There are five possible attributes to filter: color, name,
+price, species, vaccination status.
-* Deletes the person at the specified `INDEX`.
-* The index refers to the index number shown in the displayed person list.
-* The index **must be a positive integer** 1, 2, 3, …
+Format: `filter-p PREFIX/ATTRIBUTE [PREFIX/ATTRIBUTE]…`
+
+| Attribute | Prefix | Format | Example |
+|--------------------|--------|-------------|----------------|
+| Color | p_c | p_c/KEYWORD | p_c/pink |
+| Name | p_n | p_n/KEYWORD | p_n/snow white |
+| Price | p_p | p_p/NUMBER | p_p/209 |
+| Species | p_s | p_s/KEYWORD | p_s/ostrich |
+| Vaccination Status | p_v | p_v/KEYWORD | p_v/false |
Examples:
-* `list` followed by `delete 2` deletes the 2nd person in the address book.
-* `find Betsy` followed by `delete 1` deletes the 1st person in the results of the `find` command.
+
+* `filter-p p_c/white`, filters out pets of white color
+* `filter-p p_c/black p_v/true`, filters out vaccinated pets of black color
+* `filter-p p_c/grey p_n/doraemon p_p/50 p_s/cat p_v/true`, filters out vaccinated cats of grey color named doraemon sold at a price of $50
+
+[Go back to [Table of Contents](#table-of-contents)]
+[Go back to [Commands](#commands)]
+
+### Sorting contacts and items : `sort`
+
+Sorts the specified list based on the default or given attribute(s) as sorting criteria.
+
+Format: `sort KEY [ATTRIBUTE]…`
+
+#### KEY and ATTRIBUTE Table
+
+| Contact / Item to Sort | KEY | Default Sorting Criteria | Possible ATTRIBUTE to Sort (acceptable parameters) | Examples |
+|:----------------------:|:------------:|:------------------------:|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------|
+| Buyer | buyer, b | Number of orders | Name (name, n), Phone (phone, ph), Email (email, e), Location (location, l), Address (address, a), Number of Orders(order) | `sort buyer name`, `sort b p n` |
+| Supplier | supplier, s | Number of pets | Name (name, n), Phone (phone, ph), Email (email, e), Location (location, l), Address (address, a), Number of Pets(pet) | `sort supplier e`, `sort s address` |
+| Deliverer | deliverer, d | Name | Name (name, n), Phone (phone, ph), Email (email, e), Location (location, l), Address (address, a), Number of Orders(order) | `sort d location`, `sort deliverer n` |
+| Order | order, o | Due date | Due Date (duedate, d), Price Range (pricerange, pr), Settled Price (price, p), Order Status (orderstatus, os) | `sort order pr`, `sort o d p os` |
+| Pet | pet, p | Price | Price (price, p), Name (name, n), Color (color, c), Color Pattern (colorpattern, cp), Birth Date (birthdate, bd), Species (species, s), Height (height, h), Weight (weight, w) | `sort pet color`, `sort p s cp` |
+
+
+
+:information_source: When no attributes are specified as sorting criteria, the list will be sorted based on the default sorting criteria given above.
+When multiple attributes are provided, the list will be first sorted based on the first attribute, and then based on the second, and so on. For example, `sort pet price height` sorts the pet list by price first. Pets with the same price are sorted by their height.
+
+
+
+
+
+:exclamation: This command sorts the specified list in **ascending** order. For example, it will display the buyer with the **lowest** number
+of orders at the **top** of the buyer list and the buyer with the **highest** number of orders at the **bottom** of the buyer list.
+
+
+
+[Go back to [Table of Contents](#table-of-contents)]
+[Go back to [Commands](#commands)]
### Clearing all entries : `clear`
-Clears all entries from the address book.
+Clears all entries from the PetCode.
+
+
+
+:exclamation: **Caution:** Be careful when using this command as there is no `undo` command implemented yet.
+
+
Format: `clear`
+[Go back to [Table of Contents](#table-of-contents)]
+[Go back to [Commands](#commands)]
+
### Exiting the program : `exit`
Exits the program.
Format: `exit`
+[Go back to [Table of Contents](#table-of-contents)]
+[Go back to [Commands](#commands)]
+
+### Automation of information flow `[coming in v2.0]`
+
+In future versions of PetCode, some information will be auto-updated. For example, you will be able to upload vaccination proof and pet certificates to PetCode from your local disk.
+`Vaccination status` will be set to `true` once the system detects the vaccination proof file, and `pet certificates` will be set to the titles of the pet certificate documents uploaded.
+You will also be able to transfer orders from buyers to suppliers and then to deliverers. The `order status` will be auto-updated from `Pending` to `Negotiating` to `Delivering` in the process.
+
+This is the reason why you are unable to modify some information or interact with certain UI elements, and why some information, although you can enter and store in PetCode, is not displayed in the UI, in the current version.
+
+[Go back to [Table of Contents](#table-of-contents)]
+[Go back to [Commands](#commands)]
+
+## How data is stored
### Saving the data
-AddressBook data are saved in the hard disk automatically after any command that changes the data. There is no need to save manually.
+PetCode data is saved into your computer's hard disk automatically after any command that changes the data.
+There is no need to save manually.
### Editing the data file
-AddressBook data are saved as a JSON file `[JAR file location]/data/addressbook.json`. Advanced users are welcome to update data directly by editing that data file.
+PetCode data is saved as a JSON file `[JAR file location]/data/addressbook.json`.
+Advanced users are welcome to update the data directly by editing that data file.
+
+
+
+:exclamation: **Caution:** Please do not edit the id and ids that are stored in the data file. These ids acted as primary keys and foreign keys and are used to recognise the relationship between order/pet and buyer/supplier.
+
+
+
+
+
+:exclamation: **Caution:** If your changes to the data file makes its format invalid, PetCode will discard all data and
+start with an empty data file at the next run. For certain data changes, PetCode will discard the change and initialise the respective data value to its default value.
-
:exclamation: **Caution:**
-If your changes to the data file makes its format invalid, AddressBook will discard all data and start with an empty data file at the next run.
### Archiving data files `[coming in v2.0]`
_Details coming soon ..._
+[Go back to [Table of Contents](#table-of-contents)]
+
--------------------------------------------------------------------------------------------------------------------
## FAQ
**Q**: How do I transfer my data to another Computer?
-**A**: Install the app in the other computer and overwrite the empty data file it creates with the file that contains the data of your previous AddressBook home folder.
+**A**: Install the app in the other computer and overwrite the empty data file it creates with the file that contains
+the data of your previous PetCode home folder.
+
+**Q**: What is being the same? Why does the app tell me that the buyer/deliverer/supplier already exits in the list? How
+are contacts and items considered as duplicates?
+**A**: Unfortunately, we do not allow duplicate contacts or items in our app, otherwise you may mistakenly modify a
+person that you don't intend to! For buyer/deliverer/supplier, if they are of the same person category and have the same
+name and the same email address, they are considered as the same. However, we do allow a buyer and a deliverer to have
+exactly the same name and the same email, even all attributes being identical. That is, we allow a person to have more
+than one role in our app.
+Two pets are considered as the same if they have all the same attributes. Two orders are different even they have all
+the same attributes.
+For example, `"John"` is the same as `"John"`, not the same as `"john"`, `" john "`, or `"jOhn"`.
+
+[Go back to [Table of Contents](#table-of-contents)]
--------------------------------------------------------------------------------------------------------------------
-## Command summary
-
-Action | Format, Examples
---------|------------------
-**Add** | `add n/NAME p/PHONE_NUMBER e/EMAIL a/ADDRESS [t/TAG]…` e.g., `add n/James Ho p/22224444 e/jamesho@example.com a/123, Clementi Rd, 1234665 t/friend t/colleague`
-**Clear** | `clear`
-**Delete** | `delete INDEX` e.g., `delete 3`
-**Edit** | `edit INDEX [n/NAME] [p/PHONE_NUMBER] [e/EMAIL] [a/ADDRESS] [t/TAG]…` e.g.,`edit 2 n/James Lee e/jameslee@example.com`
-**Find** | `find KEYWORD [MORE_KEYWORDS]` e.g., `find James Jake`
-**List** | `list`
-**Help** | `help`
+## Summaries
+### List of Prefixes
+
+These prefixes are for you to indicate different parameters when you add a new [buyer](#adding-a-buyer-add-b), a new [deliverer](#adding-a-deliverer-add-d), a new [supplier](#adding-a-supplier-add-s), a new [order](#adding-an-order-to-a-buyer-add-o), or a new [pet](#adding-a-pet-to-a-supplier--add-p).
+
+| Prefix | Category | Meaning | Usage | Example |
+|-----------|-----------------|-----------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------|
+| `n/` | General Person | Name | A string of alphanumeric and characters and whitespaces. Required. | `n/John Halstead` |
+| `ph/` | General Person | Phone number | Numbers only. Required. | `ph/80334455` |
+| `e/` | General Person | Email address | A string of characters. Must contain `@` and follow email format. Required. | `e/1324@sample.com` |
+| `a/` | General Person | Address | A string of any characters. Required. | `a/36 College Ave East, Singapore 138600` |
+| `l/` | General Person | Location (country) of this person | A string of alphanumeric characters. Required. | `l/Singapore`, `USA`, `China` |
+| `o/` | Order | Order | Always followed by `add-o`. Optional, if no orders to add when adding a buyer. Can have multiple. | `o/add-o` |
+| `o_st/` | Order | Order status | `Pending`, `Negotiating`, or `Delivering` | `o_st/Pending` |
+| `o_p/` | Order | Settled price | A non-negative decimal number. Use `-1` to indicate not settled price. Must be within the price range. Required. | `o_p/38.6` |
+| `o_pr/` | Order | Acceptable price range | This is for you to use when negotiating with buyer -- the range the price is expected to fall within. Two non-negative decimal numbers, separated by a comma `,`. The first must not be greater than the second unless the second one is `-1`, which is used to indicate that you haven't settled down one or two of the bounds. Required. | `o_pr/-1, -1`, `o_pr/2.9, -1`, `o_pr/4.3, 19.5` |
+| `o_d/` | Order | Transaction (scheduled) date | In the format `yyyy-MM-dd`. | `o_d/2022-10-28`, `o_d/2022-9-2` |
+| `o_r/` | Order (Request) | Order request | Always followed by `add-r`. The Request group of prefixes describe what kind of pet this order seeks. Required. | `o_r/add-r` |
+| `o_a/` | Order (Request) | Requested pet age | A non-negative whole number. Required. | `o_a/5` |
+| `o_sp/` | Order (Request) | Requested pet species | A string of alphanumeric and characters and whitespaces. Required. | `o_sp/Chihuahua`, `o_sp/German shepherd` |
+| `o_c/` | Order (Request) | Requested pet color | A string of alphanumeric and characters and whitespaces. Required. | `o_c/red` |
+| `o_cp/` | Order (Request) | Requested pet color pattern | A string of alphanumeric and characters and whitespaces. This describes the appearance of the pet in more detail. Required. | `o_cp/white stripped`, `o_cp/black dotted` |
+| `o_ar/` | Order | Additional request of the order | A string of alphanumeric and characters and whitespaces. Optional. Can have multiple. | `o_ar/free delivery`, `o_ar/arrive in 10 days` |
+| `p/` | Pet | Pet | Always followed by `add-p`. Optional, if no orders to add when adding a supplier. Can have multiple. | `p/add-p` |
+| `p_n/` | Pet | Pet name | A string of alphanumeric and characters and whitespaces. Required. | `p_n/Page` |
+| `p_s/` | Pet | Species | A string of alphanumeric and characters and whitespaces. Required. | `p_s/Chihuahua`, `p_s/German shepherd` |
+| `p_d/` | Pet | Date of birth of the pet | In the format `yyyy-MM-dd`. Cannot be a date in future. Required. | `p_d/2020-3-29` |
+| `p_c/` | Pet | Color | A string of alphanumeric and characters and whitespaces. Required. | `p_c/blue` |
+| `p_cp/` | Pet | Color pattern | A string of alphanumeric and characters and whitespaces. This describes the appearance of the pet in more detail. Required. | `p_cp/blue grids` |
+| `p_h/` | Pet | Height | A non-negative decimal number. The unit is cm. Required. | `p_h/33.2` |
+| `p_w/` | Pet | Weight | A non-negative decimal number. The unit is kg. Required. | `p_w/58.2` |
+| `p_p/` | Pet | Price | A non-negative decimal number. This is the price the pet is to be sold at. Use `-1` to indicate not settled price. Required. | `p_p/55.5` |
+| `p_v/` | Pet | Vaccination status | `true` if the pet is vaccinated, otherwise `false`. Required. | `p_v/false` |
+| `p_cert/` | Pet | Certificate | A string of alphanumeric and characters and whitespaces. Other certificates this pet holds. Optional. Can have multiple. | `p_cert/US certified`, `p_cert/noble blood` |
+
+
+
+:information_source: `-0` is also considered as negative.
+
+
+
+### Command Summary
+
+| Action | Format | Examples |
+|:--------------------------------------------------------------------------:|-------------------------------------------------------------------------------------------|-------------------------------------------------------------------------|
+| **[Add](#adding-a-contact-or-item--add)** | `add-ROLE n/NAME b/BREED ph/PHONE_NUMBER e/EMAIL a/ADDRESS l/LOCATION` | `add-b n/Hongyi ph/11223344 e/hhygg@u.nus.edu a/UTR 138600 l/Singapore` |
+| **[Add](#adding-a-contact-with-a-popup-window--add)** (using popup window) | `add buyer`, `add supplier` | |
+| **[Check](#checking-which-item-belongs-to-which-contact--check)** | `check KEY INDEX` | `check buyer 1` |
+| **[Clear](#clearing-all-entries--clear)** | `clear` | |
+| **[Delete](#deleting-a-contact-or-item--delete)** | `delete-KEY INDEX` | `delete-b 1`, `delete-d 2`, `delete-s 3`, `delete-o 1`, `delete-p 2` |
+| **[Edit](#editing-attributes-of-a-contact--edit)** | `edit-KEY INDEX [n/NAME] [ph/PHONE] [e/EMAIL] [a/ADDRESS] [l/LOCATION]` | `edit-b 1 n/Alex`, `edit-s 3 n/Bobby ph/884321` |
+| **[Find](#finding-contacts-using-keywords--find)** | `find PREFIX/ATTRIBUTE` | `find n/James Jake` |
+| **[Find Buyer](#finding-a-buyer--find-b)** | `find-b PREFIX/ATTRIBUTE` | `find-b n/James Jake` |
+| **[Find Deliverer](#finding-a-deliverer--find-d)** | `find-d PREFIX/ATTRIBUTE` | `find-d n/James Jake` |
+| **[Find Supplier](#finding-a-supplier--find-s)** | `find-s PREFIX/ATTRIBUTE` | `find-s n/James Jake` |
+| **[Filter Orders](#filtering-orders--filter-o)** | `filter-o PREFIX/ATTRIBUTE` | `filter-o o_ar/non-allergic o_pr/10-100` |
+| **[Filter Pets](#filtering-pets--filter-p)** | `filter-p PREFIX/ATTRIBUTE` | `filter-p p_c/white p_s/capybara` |
+| **[Help](#viewing-help--help)** | `help` | |
+| **[List](#listing-contacts-or-items--list)** | `list all`, `list buyer`, `list supplier`, `list deliverer`, `list order`, `list pet` | |
+| **[Sort](#sorting-contacts--sort)** | `sort KEY [ATTRIBUTE]…` | `sort pet price height weight` |
+
+[Go back to [Table of Contents](#table-of-contents)]
diff --git a/docs/_config.yml b/docs/_config.yml
index 6bd245d8f4e..17fbc5a2674 100644
--- a/docs/_config.yml
+++ b/docs/_config.yml
@@ -1,4 +1,4 @@
-title: "AB-3"
+title: "PetCode"
theme: minima
header_pages:
@@ -8,7 +8,7 @@ header_pages:
markdown: kramdown
-repository: "se-edu/addressbook-level3"
+repository: "AY2223S1-CS2103T-T09-2/tp"
github_icon: "images/github-icon.png"
plugins:
diff --git a/docs/_sass/minima/_base.scss b/docs/_sass/minima/_base.scss
index 0d3f6e80ced..7cc1562893a 100644
--- a/docs/_sass/minima/_base.scss
+++ b/docs/_sass/minima/_base.scss
@@ -288,7 +288,7 @@ table {
text-align: center;
}
.site-header:before {
- content: "AB-3";
+ content: "PetCode";
font-size: 32px;
}
}
diff --git a/docs/diagrams/ArchitectureSequenceDiagram.puml b/docs/diagrams/ArchitectureSequenceDiagram.puml
index ef81d18c337..a579952705d 100644
--- a/docs/diagrams/ArchitectureSequenceDiagram.puml
+++ b/docs/diagrams/ArchitectureSequenceDiagram.puml
@@ -7,13 +7,13 @@ Participant ":Logic" as logic LOGIC_COLOR
Participant ":Model" as model MODEL_COLOR
Participant ":Storage" as storage STORAGE_COLOR
-user -[USER_COLOR]> ui : "delete 1"
+user -[USER_COLOR]> ui : "delete-b 1"
activate ui UI_COLOR
-ui -[UI_COLOR]> logic : execute("delete 1")
+ui -[UI_COLOR]> logic : execute("delete-b 1")
activate logic LOGIC_COLOR
-logic -[LOGIC_COLOR]> model : deletePerson(p)
+logic -[LOGIC_COLOR]> model : deleteBuyer(b)
activate model MODEL_COLOR
model -[MODEL_COLOR]-> logic
diff --git a/docs/diagrams/DeleteCommandParserClasses.puml b/docs/diagrams/DeleteCommandParserClasses.puml
new file mode 100644
index 00000000000..45b6f73ad51
--- /dev/null
+++ b/docs/diagrams/DeleteCommandParserClasses.puml
@@ -0,0 +1,45 @@
+@startuml
+!include style.puml
+skinparam arrowThickness 1.1
+skinparam arrowColor LOGIC_COLOR_T4
+skinparam classBackgroundColor LOGIC_COLOR
+
+Class "{abstract}\nDeleteCommand" as DeleteCommand
+Class DeleteBuyerCommand
+Class DeleteDelivererCommand
+Class DeleteSupplierCommand
+Class DeleteOrderCommand
+Class DeletePetCommand
+
+package "Parser classes"{
+Class "<>\nParser" as Parser
+Class AddressBookParser
+Class DeleteBuyerCommandParser
+Class DeleteSupplierCommandParser
+Class DeleteDelivererCommandParser
+Class DeleteOrderCommandParser
+Class DeletePetCommandParser
+}
+
+Class HiddenOutside #FFFFFF
+HiddenOutside ..> AddressBookParser
+
+AddressBookParser .down.> DeleteBuyerCommandParser: creates >
+AddressBookParser .down.> DeleteSupplierCommandParser: creates >
+AddressBookParser .down.> DeleteDelivererCommandParser: creates >
+AddressBookParser .down.> DeleteOrderCommandParser: creates >
+AddressBookParser .down.> DeletePetCommandParser: creates >
+
+DeleteBuyerCommandParser .down.|> Parser
+DeleteSupplierCommandParser .down.|> Parser
+DeleteDelivererCommandParser .down.|> Parser
+DeleteOrderCommandParser .down.|> Parser
+DeletePetCommandParser .down.|> Parser
+
+AddressBookParser ..> DeleteCommand : returns >
+DeleteBuyerCommand -up-|> DeleteCommand
+DeleteSupplierCommand -up-|> DeleteCommand
+DeleteDelivererCommand -up-|> DeleteCommand
+DeleteOrderCommand -up-|> DeleteCommand
+DeletePetCommand -up-|> DeleteCommand
+@enduml
diff --git a/docs/diagrams/DeleteSequenceDiagram.puml b/docs/diagrams/DeleteSequenceDiagram.puml
index 1dc2311b245..312c6c1e5f5 100644
--- a/docs/diagrams/DeleteSequenceDiagram.puml
+++ b/docs/diagrams/DeleteSequenceDiagram.puml
@@ -4,8 +4,8 @@
box Logic LOGIC_COLOR_T1
participant ":LogicManager" as LogicManager LOGIC_COLOR
participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR
-participant ":DeleteCommandParser" as DeleteCommandParser LOGIC_COLOR
-participant "d:DeleteCommand" as DeleteCommand LOGIC_COLOR
+participant ":DeleteBuyerCommandParser" as DeleteBuyerCommandParser LOGIC_COLOR
+participant "d:DeleteBuyerCommand" as DeleteBuyerCommand LOGIC_COLOR
participant ":CommandResult" as CommandResult LOGIC_COLOR
end box
@@ -13,56 +13,56 @@ box Model MODEL_COLOR_T1
participant ":Model" as Model MODEL_COLOR
end box
-[-> LogicManager : execute("delete 1")
+[-> LogicManager : execute("delete-b 1")
activate LogicManager
-LogicManager -> AddressBookParser : parseCommand("delete 1")
+LogicManager -> AddressBookParser : parseCommand("delete-b 1")
activate AddressBookParser
-create DeleteCommandParser
-AddressBookParser -> DeleteCommandParser
-activate DeleteCommandParser
+create DeleteBuyerCommandParser
+AddressBookParser -> DeleteBuyerCommandParser
+activate DeleteBuyerCommandParser
-DeleteCommandParser --> AddressBookParser
-deactivate DeleteCommandParser
+DeleteBuyerCommandParser -> DeleteBuyerCommandParser : parse("1")
+activate DeleteBuyerCommandParser
-AddressBookParser -> DeleteCommandParser : parse("1")
-activate DeleteCommandParser
+create DeleteBuyerCommand
+DeleteBuyerCommandParser -> DeleteBuyerCommand
+activate DeleteBuyerCommand
-create DeleteCommand
-DeleteCommandParser -> DeleteCommand
-activate DeleteCommand
+DeleteBuyerCommand --> DeleteBuyerCommandParser : d
+deactivate DeleteBuyerCommand
-DeleteCommand --> DeleteCommandParser : d
-deactivate DeleteCommand
+DeleteBuyerCommandParser --> DeleteBuyerCommandParser : d
+deactivate DeleteBuyerCommandParser
-DeleteCommandParser --> AddressBookParser : d
-deactivate DeleteCommandParser
+DeleteBuyerCommandParser --> AddressBookParser : d
+deactivate DeleteBuyerCommandParser
'Hidden arrow to position the destroy marker below the end of the activation bar.
-DeleteCommandParser -[hidden]-> AddressBookParser
-destroy DeleteCommandParser
+DeleteBuyerCommandParser -[hidden]-> AddressBookParser
+destroy DeleteBuyerCommandParser
AddressBookParser --> LogicManager : d
deactivate AddressBookParser
-LogicManager -> DeleteCommand : execute()
-activate DeleteCommand
+LogicManager -> DeleteBuyerCommand : execute()
+activate DeleteBuyerCommand
-DeleteCommand -> Model : deletePerson(1)
+DeleteBuyerCommand -> Model : deleteBuyer(1)
activate Model
-Model --> DeleteCommand
+Model --> DeleteBuyerCommand
deactivate Model
create CommandResult
-DeleteCommand -> CommandResult
+DeleteBuyerCommand -> CommandResult
activate CommandResult
-CommandResult --> DeleteCommand
+CommandResult --> DeleteBuyerCommand : result
deactivate CommandResult
-DeleteCommand --> LogicManager : result
-deactivate DeleteCommand
+DeleteBuyerCommand --> LogicManager : result
+deactivate DeleteBuyerCommand
[<--LogicManager
deactivate LogicManager
diff --git a/docs/diagrams/LogicClassDiagram.puml b/docs/diagrams/LogicClassDiagram.puml
index d4193173e18..7612e1b6a7b 100644
--- a/docs/diagrams/LogicClassDiagram.puml
+++ b/docs/diagrams/LogicClassDiagram.puml
@@ -38,7 +38,7 @@ LogicManager --> Storage
Storage --[hidden] Model
Command .[hidden]up.> Storage
Command .right.> Model
-note right of XYZCommand: XYZCommand = AddCommand, \nFindCommand, etc
+note right of XYZCommand: XYZCommand = AddBuyerCommand, \nFindCommand, etc
Logic ..> CommandResult
LogicManager .down.> CommandResult
diff --git a/docs/diagrams/MatchCommandSequenceDiagram1.puml b/docs/diagrams/MatchCommandSequenceDiagram1.puml
new file mode 100644
index 00000000000..54ac7f7a155
--- /dev/null
+++ b/docs/diagrams/MatchCommandSequenceDiagram1.puml
@@ -0,0 +1,49 @@
+@startuml
+!include style.puml
+
+box Logic LOGIC_COLOR_T1
+participant ":LogicManager" as LogicManager LOGIC_COLOR
+participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR
+participant ":MatchCommandParser" as MatchCommandParser LOGIC_COLOR
+participant "m:MatchCommand" as MatchCommand LOGIC_COLOR
+end box
+
+[-> LogicManager : execute("match 1")
+activate LogicManager
+
+LogicManager -> AddressBookParser
+activate AddressBookParser
+
+create MatchCommandParser
+AddressBookParser -> MatchCommandParser
+activate MatchCommandParser
+
+MatchCommandParser -> MatchCommandParser : parse("1")
+activate MatchCommandParser
+
+create MatchCommand
+MatchCommandParser -> MatchCommand
+activate MatchCommand
+
+MatchCommand --> MatchCommandParser : m
+deactivate MatchCommand
+
+MatchCommandParser --> MatchCommandParser : m
+deactivate MatchCommandParser
+
+MatchCommandParser --> AddressBookParser : m
+deactivate MatchCommandParser
+'Hidden arrow to position the destroy marker below the end of the activation bar.
+MatchCommandParser -[hidden]-> AddressBookParser
+destroy MatchCommandParser
+
+AddressBookParser --> LogicManager : m
+deactivate AddressBookParser
+
+ref over LogicManager, MatchCommand
+ execute(model) - execution of the Match Command
+end ref
+
+[<--LogicManager
+deactivate LogicManager
+@enduml
diff --git a/docs/diagrams/MatchCommandSequenceDiagram2.puml b/docs/diagrams/MatchCommandSequenceDiagram2.puml
new file mode 100644
index 00000000000..b924c4613fc
--- /dev/null
+++ b/docs/diagrams/MatchCommandSequenceDiagram2.puml
@@ -0,0 +1,87 @@
+@startuml
+!include style.puml
+
+box Logic LOGIC_COLOR_T1
+participant ":LogicManager" as LogicManager LOGIC_COLOR
+participant "m:MatchCommand" as MatchCommand LOGIC_COLOR
+participant ":CommandResult" as CommandResult LOGIC_COLOR
+participant "petScoreMap:HashMap" as HashMap LOGIC_COLOR
+participant "comparator:Comparator" as Comparator LOGIC_COLOR
+end box
+
+box Model MODEL_COLOR_T1
+participant "model:Model" as Model MODEL_COLOR
+participant "grader:PetGrader" as PetGrader MODEL_COLOR
+end box
+
+[-> LogicManager : execute("match 1")
+activate LogicManager
+
+ref over LogicManager, MatchCommand
+ Creation of MatchCommand
+end ref
+
+LogicManager -> MatchCommand : execute(model)
+activate MatchCommand
+
+create PetGrader
+MatchCommand -> PetGrader
+activate PetGrader
+
+PetGrader --> MatchCommand : grader
+deactivate PetGrader
+
+create HashMap
+MatchCommand -> HashMap
+activate HashMap
+
+HashMap --> MatchCommand : petScoreMap
+deactivate HashMap
+
+loop until there are no more pets in filteredPets
+ MatchCommand -> HashMap
+ activate HashMap
+ HashMap -> HashMap : put(Pet, PetGrader)
+ activate HashMap
+ HashMap -> PetGrader : evaluate(Pet)
+ activate PetGrader
+ PetGrader --> HashMap : score
+ deactivate PetGrader
+ deactivate HashMap
+
+end
+ HashMap --> MatchCommand : petScoreMap
+ deactivate HashMap
+
+create Comparator
+MatchCommand -> Comparator
+activate Comparator
+
+Comparator --> MatchCommand : comparator
+deactivate Comparator
+
+MatchCommand -> Model : sortPet(comparator)
+activate Model
+
+Model --> MatchCommand
+deactivate Model
+
+MatchCommand -> Model : switchToPetList()
+activate Model
+
+Model --> MatchCommand
+deactivate Model
+
+create CommandResult
+MatchCommand -> CommandResult
+activate CommandResult
+
+CommandResult --> MatchCommand
+deactivate CommandResult
+
+MatchCommand --> LogicManager : result
+deactivate MatchCommand
+
+[<--LogicManager
+deactivate LogicManager
+@enduml
diff --git a/docs/diagrams/ModelBuyerObjectImplementation.puml b/docs/diagrams/ModelBuyerObjectImplementation.puml
new file mode 100644
index 00000000000..bdb93fc2b32
--- /dev/null
+++ b/docs/diagrams/ModelBuyerObjectImplementation.puml
@@ -0,0 +1,31 @@
+@startuml
+!include style.puml
+skinparam arrowThickness 1.1
+skinparam arrowColor MODEL_COLOR
+skinparam classBackgroundColor MODEL_COLOR
+
+Class AddressBook
+Class UniqueBuyerList
+Class Buyer
+Class Person
+Class PersonCategory
+Class Name
+Class Phone
+Class Email
+Class Address
+Class Tag
+Class UniqueId
+
+AddressBook *--> "1" UniqueBuyerList
+Buyer .up.|> Person
+
+UniqueBuyerList-right->"0..*" Buyer
+
+Buyer *--> "1" PersonCategory
+Buyer *--> "1" Name
+Buyer *--> "1" Phone
+Buyer *--> "1" Email
+Buyer *--> "1" Address
+Buyer *--> "*" Tag
+Buyer *--> "~* orders" UniqueId
+@enduml
diff --git a/docs/diagrams/ModelClassDiagram.puml b/docs/diagrams/ModelClassDiagram.puml
index 4439108973a..841cedc3610 100644
--- a/docs/diagrams/ModelClassDiagram.puml
+++ b/docs/diagrams/ModelClassDiagram.puml
@@ -12,14 +12,17 @@ Class AddressBook
Class ModelManager
Class UserPrefs
-Class UniquePersonList
-Class Person
-Class Address
-Class Email
-Class Name
-Class Phone
-Class Tag
-
+Class UniqueBuyerList
+Class UniqueDelivererList
+Class UniqueSupplierList
+Class UniqueOrderList
+Class UniquePetList
+
+Class Buyer
+Class Deliverer
+Class Supplier
+Class Order
+Class Pet
}
Class HiddenOutside #FFFFFF
@@ -27,24 +30,34 @@ HiddenOutside ..> Model
AddressBook .up.|> ReadOnlyAddressBook
-ModelManager .up.|> Model
+ModelManager .up.....|> Model
Model .right.> ReadOnlyUserPrefs
Model .left.> ReadOnlyAddressBook
-ModelManager -left-> "1" AddressBook
+ModelManager -up-> "1" AddressBook
ModelManager -right-> "1" UserPrefs
-UserPrefs .up.|> ReadOnlyUserPrefs
-
-AddressBook *--> "1" UniquePersonList
-UniquePersonList --> "~* all" Person
-Person *--> Name
-Person *--> Phone
-Person *--> Email
-Person *--> Address
-Person *--> "*" Tag
-
-Name -[hidden]right-> Phone
-Phone -[hidden]right-> Address
-Address -[hidden]right-> Email
+UserPrefs .up.....|> ReadOnlyUserPrefs
+
+AddressBook *--> "1" UniqueBuyerList
+AddressBook *--> "1" UniqueDelivererList
+AddressBook *--> "1" UniqueSupplierList
+AddressBook *--> "1" UniqueOrderList
+AddressBook *--> "1" UniquePetList
+
+UniqueBuyerList-down->"all" Buyer
+UniqueDelivererList-down->"all" Deliverer
+UniqueSupplierList-down->"all" Supplier
+UniqueOrderList-down->"all" Order
+UniquePetList-down->"all" Pet
+
+ModelManager-up-->"filtered" Buyer
+ModelManager-up-->"filtered" Deliverer
+ModelManager-up-->"filtered" Supplier
+ModelManager-up-->"filtered" Order
+ModelManager-up-->"filtered" Pet
+
+UniqueBuyerList -right[hidden]- UniqueSupplierList
+UniqueSupplierList -right[hidden]- UniqueDelivererList
+UniqueDelivererList -right[hidden]- UniqueOrderList
+UniqueOrderList -right[hidden]- UniquePetList
-ModelManager -->"~* filtered" Person
@enduml
diff --git a/docs/diagrams/ModelOrderObjectImplementation b/docs/diagrams/ModelOrderObjectImplementation
new file mode 100644
index 00000000000..91a623db6f5
--- /dev/null
+++ b/docs/diagrams/ModelOrderObjectImplementation
@@ -0,0 +1,34 @@
+@startuml
+!include style.puml
+skinparam arrowThickness 1.1
+skinparam arrowColor MODEL_COLOR
+skinparam classBackgroundColor MODEL_COLOR
+
+Class AddressBook
+Class UniqueOrderList
+Class Order
+Class Buyer
+Class PriceRange
+Class Request
+Class AdditionalRequests
+Class LocalDate
+Class Price
+Class "<>\nOrderStatus" as OrderStatus
+Class UniqueId
+
+AddressBook *--> "1" UniqueOrderList
+
+UniqueOrderList-right->"0..*" Order
+
+Order *--> Buyer
+Order *--> PriceRange
+Order *--> Request
+Order *--> AdditionalRequests
+Order *--> OrderStatus
+Order *--> UniqueId
+Order *--> "byDate" LocalDate
+Order *--> "settled price" Price
+
+Price -left[hidden]- LocalDate
+LocalDate -left[hidden]- Price
+@enduml
diff --git a/docs/diagrams/ModelPetObjectImplementation b/docs/diagrams/ModelPetObjectImplementation
new file mode 100644
index 00000000000..3d90d22030d
--- /dev/null
+++ b/docs/diagrams/ModelPetObjectImplementation
@@ -0,0 +1,39 @@
+@startuml
+!include style.puml
+skinparam arrowThickness 1.1
+skinparam arrowColor MODEL_COLOR
+skinparam classBackgroundColor MODEL_COLOR
+
+Class AddressBook
+Class UniquePetList
+Class Supplier
+Class Color
+Class ColorPattern
+Class DateOfBirth
+Class Species
+Class Weight
+Class Height
+Class VaccinationStatus
+Class UniqueId
+Class Price
+Class Tag
+Class PetCertificate
+
+AddressBook *--> "1" UniquePetList
+
+UniquePetList-right->"0..*" Pet
+
+Pet *--> "1" Supplier
+Pet *--> "1" Color
+Pet *--> "1" ColorPattern
+Pet *--> "1" DateOfBirth
+Pet *--> "1" Species
+Pet *--> "1" Weight
+Pet *--> "1" Height
+Pet *--> "1" VaccinationStatus
+Pet *--> "1" UniqueId
+Pet *--> "1" Price
+Pet *--> "0..*" Tag
+Pet *--> "0..*" PetCertificate
+
+@enduml
diff --git a/docs/diagrams/ModelSupplierObjectImplementation b/docs/diagrams/ModelSupplierObjectImplementation
new file mode 100644
index 00000000000..9ada029a6e6
--- /dev/null
+++ b/docs/diagrams/ModelSupplierObjectImplementation
@@ -0,0 +1,31 @@
+@startuml
+!include style.puml
+skinparam arrowThickness 1.1
+skinparam arrowColor MODEL_COLOR
+skinparam classBackgroundColor MODEL_COLOR
+
+Class AddressBook
+Class UniqueSupplierList
+Class Supplier
+Class Person
+Class PersonCategory
+Class Name
+Class Phone
+Class Email
+Class Address
+Class Tag
+Class UniqueId
+
+AddressBook *--> "1" UniqueSupplierList
+Supplier .up.|> Person
+
+UniqueSupplierList-right->"0..*" Supplier
+
+Supplier *--> "1" PersonCategory
+Supplier *--> "1" Name
+Supplier *--> "1" Phone
+Supplier *--> "1" Email
+Supplier *--> "1" Address
+Supplier *--> "*" Tag
+Supplier *--> "~* pets" UniqueId
+@enduml
diff --git a/docs/diagrams/OldUiClassDiagram.puml b/docs/diagrams/OldUiClassDiagram.puml
new file mode 100644
index 00000000000..225c1ebe369
--- /dev/null
+++ b/docs/diagrams/OldUiClassDiagram.puml
@@ -0,0 +1,35 @@
+@startuml
+!include style.puml
+skinparam arrowThickness 1.1
+skinparam arrowColor UI_COLOR_T4
+skinparam classBackgroundColor UI_COLOR
+
+package UI <>{
+Class "<>\nUi" as Ui
+Class UiManager
+Class MainWindow
+Class PersonListPanel
+Class PersonCard
+}
+
+package Model <> {
+Class HiddenModel #FFFFFF
+}
+
+package Logic <> {
+Class HiddenLogic #FFFFFF
+}
+
+Class HiddenOutside #FFFFFF
+HiddenOutside .right.> Ui
+
+UiManager --> Logic
+MainWindow --> Logic
+UiManager ..|> Ui
+UiManager --> "1" MainWindow
+
+MainWindow --> "1" PersonListPanel
+PersonListPanel --> "*" PersonCard
+PersonCard ..> Model
+
+@enduml
diff --git a/docs/diagrams/PopupWindowActivityDiagram.puml b/docs/diagrams/PopupWindowActivityDiagram.puml
new file mode 100644
index 00000000000..aadd5d5079f
--- /dev/null
+++ b/docs/diagrams/PopupWindowActivityDiagram.puml
@@ -0,0 +1,25 @@
+@startuml
+'https://plantuml.com/activity-diagram-beta
+
+start
+
+:User types the command in main window;
+:Main window creates the pop-up window;
+:User inputs information in text fields;
+:User saves the inputs;
+
+while () is ([else])
+ if () then ([has empty fields])
+ :Pop-up window highlights the empty fields;
+ else ([else])
+ :Main window displays the error message;
+ endif
+ :User saves the edited inputs;
+
+endwhile ([able to generate command from inputs])
+:Pop-up window executes the command;
+:Main window displays the result;
+:Pop-up window closes;
+stop
+
+@enduml
diff --git a/docs/diagrams/PopupWindowClassDiagram.puml b/docs/diagrams/PopupWindowClassDiagram.puml
new file mode 100644
index 00000000000..312b9e11428
--- /dev/null
+++ b/docs/diagrams/PopupWindowClassDiagram.puml
@@ -0,0 +1,64 @@
+@startuml
+!include style.puml
+skinparam arrowThickness 1.1
+skinparam arrowColor UI_COLOR_T4
+skinparam classBackgroundColor UI_COLOR
+
+package UI <>{
+Class "<>\nUi" as Ui
+Class "{abstract}\nUiPart" as UiPart
+Class "{abstract}\nPopupPanel" as PopupPanel
+Class UiManager
+Class MainWindow
+Class AddCommandPopupWindow
+Class ResultDisplay
+Class PopupPanelForBuyer
+Class PopupPanelForOrder
+Class PopupPanelForPet
+Class PopupPanelForSupplier
+}
+
+package Model <> {
+Class HiddenModel #FFFFFF
+}
+
+package Logic <> {
+Class HiddenLogic #FFFFFF
+}
+
+Class HiddenOutside #FFFFFF
+HiddenOutside ..> Ui
+UiManager .left.|> Ui
+
+UiManager --> Logic
+MainWindow -left-> Logic
+AddCommandPopupWindow--> Logic
+
+UiManager --> "1" MainWindow
+MainWindow *--> "1" ResultDisplay
+MainWindow --> "0..1" AddCommandPopupWindow
+AddCommandPopupWindow -left-> "1" ResultDisplay
+AddCommandPopupWindow *--> "0..1" PopupPanelForBuyer
+AddCommandPopupWindow *--> "0..1" PopupPanelForSupplier
+
+MainWindow -left-|> UiPart
+ResultDisplay --|> UiPart
+AddCommandPopupWindow --|> UiPart
+PopupPanel --|> UiPart
+
+PopupPanelForBuyer --|> PopupPanel
+PopupPanelForSupplier --|> PopupPanel
+PopupPanelForOrder --|> PopupPanel
+PopupPanelForPet --|> PopupPanel
+
+PopupPanelForBuyer --> "*" PopupPanelForOrder
+PopupPanelForSupplier --> "*" PopupPanelForPet
+
+PopupPanelForBuyer ..> Model
+PopupPanelForSupplier ..> Model
+PopupPanelForOrder ..> Model
+PopupPanelForPet ..> Model
+
+PopupPanel -[hidden]down- Model
+
+@enduml
diff --git a/docs/diagrams/PopupWindowSequenceDiagram1.puml b/docs/diagrams/PopupWindowSequenceDiagram1.puml
new file mode 100644
index 00000000000..c6123365c66
--- /dev/null
+++ b/docs/diagrams/PopupWindowSequenceDiagram1.puml
@@ -0,0 +1,69 @@
+@startuml
+!include style.puml
+
+box Ui UI_COLOR_T1
+participant ":MainWindow" as MainWindow UI_COLOR
+participant ":AddCommandPopupWindow" as AddCommandPopupWindow UI_COLOR
+participant ":PopupPanelForSupplier" as PopupPanelForSupplier UI_COLOR
+end box
+
+box Logic LOGIC_COLOR_T1
+participant ":LogicManager" as LogicManager LOGIC_COLOR
+participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR
+participant "a:AddCommandWithPopup" as AddCommandWithPopup LOGIC_COLOR
+end box
+
+[-> MainWindow : executeCommand("add supplier")
+activate MainWindow
+
+MainWindow -> LogicManager : execute("add supplier")
+activate LogicManager
+
+LogicManager -> AddressBookParser : parseCommand(""add supplier")
+activate AddressBookParser
+
+create AddCommandWithPopup
+AddressBookParser -> AddCommandWithPopup
+activate AddCommandWithPopup
+
+AddCommandWithPopup --> AddressBookParser
+deactivate AddCommandWithPopup
+
+AddressBookParser --> LogicManager : a
+deactivate AddressBookParser
+
+LogicManager -> AddCommandWithPopup : execute()
+activate AddCommandWithPopup
+
+AddCommandWithPopup --> LogicManager : command result
+deactivate AddCommandWithPopup
+AddCommandWithPopup -[hidden]-> LogicManager
+destroy AddCommandWithPopup
+
+LogicManager --> MainWindow : command result
+deactivate LogicManager
+
+MainWindow -> MainWindow : handleAddByPopup("SUPPLIER")
+activate MainWindow
+
+create AddCommandPopupWindow
+MainWindow -> AddCommandPopupWindow
+activate AddCommandPopupWindow
+
+create PopupPanelForSupplier
+AddCommandPopupWindow -> PopupPanelForSupplier
+activate PopupPanelForSupplier
+
+PopupPanelForSupplier --> AddCommandPopupWindow
+deactivate PopupPanelForSupplier
+
+AddCommandPopupWindow --> MainWindow
+deactivate AddCommandPopupWindow
+
+MainWindow --> MainWindow
+deactivate MainWindow
+
+[<-- MainWindow
+deactivate MainWindow
+
+@enduml
diff --git a/docs/diagrams/PopupWindowSequenceDiagram2.puml b/docs/diagrams/PopupWindowSequenceDiagram2.puml
new file mode 100644
index 00000000000..41eb2236b79
--- /dev/null
+++ b/docs/diagrams/PopupWindowSequenceDiagram2.puml
@@ -0,0 +1,71 @@
+@startuml
+!include style.puml
+
+box Ui UI_COLOR_T1
+participant ":AddCommandPopupWindow" as AddCommandPopupWindow UI_COLOR
+participant ":PopupPanelForSupplier" as PopupPanelForSupplier UI_COLOR
+end box
+
+box Logic LOGIC_COLOR_T1
+participant "<>\nParserUtil" as ParserUtil LOGIC_COLOR
+participant ":LogicManager" as LogicManager LOGIC_COLOR
+participant "a:AddSupplierCommand" as AddSupplierCommand LOGIC_COLOR
+end box
+
+[-> AddCommandPopupWindow : saving action is detected
+activate AddCommandPopupWindow
+
+AddCommandPopupWindow -> PopupPanelForSupplier : checkAllPartsFilled()
+activate PopupPanelForSupplier
+
+PopupPanelForSupplier --> AddCommandPopupWindow
+deactivate PopupPanelForSupplier
+
+alt all required text fields filled
+
+ AddCommandPopupWindow -> PopupPanelForSupplier : generateCommand()
+ activate PopupPanelForSupplier
+
+ PopupPanelForSupplier -> PopupPanelForSupplier : generateSupplier()
+ activate PopupPanelForSupplier
+
+ loop until all inputs are parsed
+ PopupPanelForSupplier -> ParserUtil : parse attribute
+ activate ParserUtil
+ ParserUtil --> PopupPanelForSupplier : parse result
+ deactivate ParserUtil
+ end
+
+ PopupPanelForSupplier --> PopupPanelForSupplier : supplier
+ deactivate PopupPanelForSupplier
+
+ create AddSupplierCommand
+ PopupPanelForSupplier -> AddSupplierCommand
+ activate AddSupplierCommand
+
+ AddSupplierCommand --> PopupPanelForSupplier
+ deactivate AddSupplierCommand
+
+ PopupPanelForSupplier --> AddCommandPopupWindow : a
+ deactivate PopupPanelForSupplier
+
+ AddCommandPopupWindow -> LogicManager : executeGivenCommand(a)
+ activate LogicManager
+
+ LogicManager -> AddSupplierCommand : execute()
+ activate AddSupplierCommand
+
+ AddSupplierCommand --> LogicManager : command result
+ deactivate AddSupplierCommand
+
+ LogicManager --> AddCommandPopupWindow : command result
+ deactivate LogicManager
+
+else at least one compulsory text field not filled
+
+ [<-- AddCommandPopupWindow
+ deactivate AddCommandPopupWindow
+
+end
+
+@enduml
diff --git a/docs/diagrams/SortCommandParserClasses.puml b/docs/diagrams/SortCommandParserClasses.puml
new file mode 100644
index 00000000000..3a075457117
--- /dev/null
+++ b/docs/diagrams/SortCommandParserClasses.puml
@@ -0,0 +1,37 @@
+@startuml
+!include style.puml
+skinparam arrowThickness 1.1
+skinparam arrowColor LOGIC_COLOR_T4
+skinparam classBackgroundColor LOGIC_COLOR
+
+Class "{abstract}\nSortCommand" as SortCommand
+Class SortBuyerCommand
+Class SortDelivererCommand
+Class SortSupplierCommand
+Class SortOrderCommand
+Class SortPetCommand
+
+package "Parser classes"{
+Class "<>\nParser" as Parser
+Class AddressBookParser
+Class SortCommandParser
+Class SortCommandParserUtil
+Class CommandUtil
+}
+
+Class HiddenOutside #FFFFFF
+HiddenOutside ..> AddressBookParser
+
+AddressBookParser .down.> SortCommandParser: creates >
+
+SortCommandParser ..> SortCommand : creates >
+AddressBookParser ..> SortCommand : returns >
+SortCommandParser .up.|> Parser
+SortCommandParser ..> SortCommandParserUtil
+SortCommandParser ..> CommandUtil
+SortBuyerCommand -up-|> SortCommand
+SortSupplierCommand -up-|> SortCommand
+SortDelivererCommand -up-|> SortCommand
+SortOrderCommand -up-|> SortCommand
+SortPetCommand -up-|> SortCommand
+@enduml
diff --git a/docs/diagrams/StorageClassDiagram.puml b/docs/diagrams/StorageClassDiagram.puml
index 760305e0e58..dd718471615 100644
--- a/docs/diagrams/StorageClassDiagram.puml
+++ b/docs/diagrams/StorageClassDiagram.puml
@@ -18,10 +18,16 @@ package "AddressBook Storage" #F4F6F6{
Class "<>\nAddressBookStorage" as AddressBookStorage
Class JsonAddressBookStorage
Class JsonSerializableAddressBook
-Class JsonAdaptedPerson
-Class JsonAdaptedTag
+Class JsonAdaptedBuyer
+Class JsonAdaptedSupplier
+Class JsonAdaptedDeliverer
+Class JsonAdaptedOrder
+Class JsonAdaptedPet
+Class JsonAdaptedPriceRange
+Class JsonAdaptedRequest
}
+
}
Class HiddenOutside #FFFFFF
@@ -37,7 +43,14 @@ Storage -right-|> AddressBookStorage
JsonUserPrefsStorage .up.|> UserPrefsStorage
JsonAddressBookStorage .up.|> AddressBookStorage
JsonAddressBookStorage ..> JsonSerializableAddressBook
-JsonSerializableAddressBook --> "*" JsonAdaptedPerson
-JsonAdaptedPerson --> "*" JsonAdaptedTag
+JsonSerializableAddressBook --> "*" JsonAdaptedBuyer
+JsonSerializableAddressBook --> "*" JsonAdaptedSupplier
+JsonSerializableAddressBook --> "*" JsonAdaptedDeliverer
+JsonSerializableAddressBook --> "*" JsonAdaptedPet
+JsonSerializableAddressBook --> "*" JsonAdaptedOrder
+JsonAdaptedPet --> "1" JsonAdaptedSupplier
+JsonAdaptedOrder --> " 1" JsonAdaptedBuyer
+JsonAdaptedOrder --> "1" JsonAdaptedPriceRange
+JsonAdaptedOrder --> "1" JsonAdaptedRequest
@enduml
diff --git a/docs/diagrams/UiClassDiagram.puml b/docs/diagrams/UiClassDiagram.puml
index 95473d5aa19..91fca869338 100644
--- a/docs/diagrams/UiClassDiagram.puml
+++ b/docs/diagrams/UiClassDiagram.puml
@@ -11,14 +11,9 @@ Class UiManager
Class MainWindow
Class HelpWindow
Class ResultDisplay
-Class PersonListPanel
-Class PersonCard
Class StatusBarFooter
Class CommandBox
-}
-
-package Model <> {
-Class HiddenModel #FFFFFF
+Class AddCommandPopupWindow
}
package Logic <> {
@@ -32,26 +27,21 @@ UiManager .left.|> Ui
UiManager -down-> "1" MainWindow
MainWindow *-down-> "1" CommandBox
MainWindow *-down-> "1" ResultDisplay
-MainWindow *-down-> "1" PersonListPanel
MainWindow *-down-> "1" StatusBarFooter
MainWindow --> "0..1" HelpWindow
-
-PersonListPanel -down-> "*" PersonCard
+MainWindow --> "0..1" AddCommandPopupWindow
MainWindow -left-|> UiPart
-
ResultDisplay --|> UiPart
CommandBox --|> UiPart
-PersonListPanel --|> UiPart
-PersonCard --|> UiPart
StatusBarFooter --|> UiPart
HelpWindow --|> UiPart
+AddCommandPopupWindow --|> UiPart
-PersonCard ..> Model
UiManager -right-> Logic
MainWindow -left-> Logic
+AddCommandPopupWindow--> Logic
-PersonListPanel -[hidden]left- HelpWindow
HelpWindow -[hidden]left- CommandBox
CommandBox -[hidden]left- ResultDisplay
ResultDisplay -[hidden]left- StatusBarFooter
diff --git a/docs/diagrams/UiClassDiagram1.puml b/docs/diagrams/UiClassDiagram1.puml
new file mode 100644
index 00000000000..9169a02629f
--- /dev/null
+++ b/docs/diagrams/UiClassDiagram1.puml
@@ -0,0 +1,79 @@
+@startuml
+!include style.puml
+skinparam arrowThickness 1.1
+skinparam arrowColor UI_COLOR_T4
+skinparam classBackgroundColor UI_COLOR
+
+package UI <>{
+Class "<>\nUi" as Ui
+Class UiManager
+Class MainWindow
+Class MainListPanel
+Class BuyerListPanel
+Class DelivererListPanel
+Class SupplierListPanel
+Class OrderListPanel
+Class PetListPanel
+Class BuyerCard
+Class DelivererCard
+Class SupplierCard
+Class OrderCard
+Class PetCard
+}
+
+package Model <> {
+Class HiddenModel #FFFFFF
+}
+
+package Logic <> {
+Class HiddenLogic #FFFFFF
+}
+
+Class HiddenOutside #FFFFFF
+HiddenOutside ..> Ui
+
+UiManager --> Logic
+MainWindow -left-> Logic
+
+UiManager .left.|> Ui
+UiManager --> "1" MainWindow
+MainWindow *-down-> "1" MainListPanel
+MainWindow *-down-> "1" BuyerListPanel
+MainWindow *-down-> "1" DelivererListPanel
+MainWindow *-down-> "1" SupplierListPanel
+MainWindow *-down-> "1" OrderListPanel
+MainWindow *-down-> "1" PetListPanel
+
+/'MainWindow --|> UiPart
+BuyerListPanel --|> UiPart
+DelivererListPanel --|> UiPart
+SupplierListPanel --|> UiPart
+OrderListPanel --|> UiPart
+PetListPanel --|> UiPart
+BuyerCard --|> UiPart
+SupplierCard --|> UiPart
+DelivererCard --|> UiPart
+OrderCard --|> UiPart
+PetCard --|> UiPart'/
+
+MainListPanel --> "*" BuyerCard
+MainListPanel --> "*" DelivererCard
+MainListPanel --> "*" SupplierCard
+BuyerListPanel --> "*" BuyerCard
+DelivererListPanel --> "*" DelivererCard
+SupplierListPanel --> "*" SupplierCard
+OrderListPanel --> "*" OrderCard
+PetListPanel --> "*" PetCard
+BuyerCard --> "*" OrderCard
+SupplierCard --> "*" PetCard
+
+BuyerCard .right.> Model
+DelivererCard .down.> Model
+SupplierCard .down.> Model
+OrderCard .down.> Model
+PetCard .down.> Model
+
+OrderCard -[hidden]up- DelivererCard
+Model -[hidden]up- OrderCard
+
+@enduml
diff --git a/docs/diagrams/UndoRedoState0.puml b/docs/diagrams/UndoRedoState0.puml
index 96e30744d24..34885420931 100644
--- a/docs/diagrams/UndoRedoState0.puml
+++ b/docs/diagrams/UndoRedoState0.puml
@@ -15,6 +15,6 @@ State2 -[hidden]right-> State3
hide State2
hide State3
-class Pointer as "Current State" #FFFFF
+class Pointer as "Current State" #FFFFFF
Pointer -up-> State1
@end
diff --git a/docs/diagrams/UndoRedoState1.puml b/docs/diagrams/UndoRedoState1.puml
index 01fcb9b2b96..71b9f441441 100644
--- a/docs/diagrams/UndoRedoState1.puml
+++ b/docs/diagrams/UndoRedoState1.puml
@@ -3,7 +3,7 @@
skinparam ClassFontColor #000000
skinparam ClassBorderColor #000000
-title After command "delete 5"
+title After command "delete-b 5"
package States <> {
class State1 as "__ab0:AddressBook__"
@@ -16,7 +16,7 @@ State2 -[hidden]right-> State3
hide State3
-class Pointer as "Current State" #FFFFF
+class Pointer as "Current State" #FFFFFF
Pointer -up-> State2
@end
diff --git a/docs/diagrams/UndoRedoState2.puml b/docs/diagrams/UndoRedoState2.puml
index bccc230a5d1..957f8a14621 100644
--- a/docs/diagrams/UndoRedoState2.puml
+++ b/docs/diagrams/UndoRedoState2.puml
@@ -3,7 +3,7 @@
skinparam ClassFontColor #000000
skinparam ClassBorderColor #000000
-title After command "add n/David"
+title After command "add-b n/David ..."
package States <> {
class State1 as "__ab0:AddressBook__"
@@ -14,7 +14,7 @@ package States <> {
State1 -[hidden]right-> State2
State2 -[hidden]right-> State3
-class Pointer as "Current State" #FFFFF
+class Pointer as "Current State" #FFFFFF
Pointer -up-> State3
@end
diff --git a/docs/diagrams/UndoRedoState3.puml b/docs/diagrams/UndoRedoState3.puml
index ea29c9483e4..50bf43b3f34 100644
--- a/docs/diagrams/UndoRedoState3.puml
+++ b/docs/diagrams/UndoRedoState3.puml
@@ -14,7 +14,7 @@ package States <> {
State1 -[hidden]right-> State2
State2 -[hidden]right-> State3
-class Pointer as "Current State" #FFFFF
+class Pointer as "Current State" #FFFFFF
Pointer -up-> State2
@end
diff --git a/docs/diagrams/UndoRedoState4.puml b/docs/diagrams/UndoRedoState4.puml
index 1b784cece80..815db7341f5 100644
--- a/docs/diagrams/UndoRedoState4.puml
+++ b/docs/diagrams/UndoRedoState4.puml
@@ -3,7 +3,7 @@
skinparam ClassFontColor #000000
skinparam ClassBorderColor #000000
-title After command "list"
+title After command "list buyer"
package States <> {
class State1 as "__ab0:AddressBook__"
@@ -14,7 +14,7 @@ package States <> {
State1 -[hidden]right-> State2
State2 -[hidden]right-> State3
-class Pointer as "Current State" #FFFFF
+class Pointer as "Current State" #FFFFFF
Pointer -up-> State2
@end
diff --git a/docs/diagrams/UndoRedoState5.puml b/docs/diagrams/UndoRedoState5.puml
index 88927be32bc..619766f3177 100644
--- a/docs/diagrams/UndoRedoState5.puml
+++ b/docs/diagrams/UndoRedoState5.puml
@@ -14,8 +14,8 @@ package States <> {
State1 -[hidden]right-> State2
State2 -[hidden]right-> State3
-class Pointer as "Current State" #FFFFF
+class Pointer as "Current State" #FFFFFF
Pointer -up-> State3
note right on link: State ab2 deleted.
-@end
+@enduml
diff --git a/docs/diagrams/UndoSequenceDiagram.puml b/docs/diagrams/UndoSequenceDiagram.puml
index 410aab4e412..8eff0f69022 100644
--- a/docs/diagrams/UndoSequenceDiagram.puml
+++ b/docs/diagrams/UndoSequenceDiagram.puml
@@ -48,6 +48,6 @@ deactivate UndoCommand
UndoCommand -[hidden]-> LogicManager : result
destroy UndoCommand
-[<--LogicManager
+[<-- LogicManager
deactivate LogicManager
@enduml
diff --git a/docs/images/AddBuyerCommandIllustration.png b/docs/images/AddBuyerCommandIllustration.png
new file mode 100644
index 00000000000..62936464654
Binary files /dev/null and b/docs/images/AddBuyerCommandIllustration.png differ
diff --git a/docs/images/AddSupplierWithPopup.png b/docs/images/AddSupplierWithPopup.png
new file mode 100644
index 00000000000..aaff7cc35b9
Binary files /dev/null and b/docs/images/AddSupplierWithPopup.png differ
diff --git a/docs/images/AfterMatch.png b/docs/images/AfterMatch.png
new file mode 100644
index 00000000000..578634e22ac
Binary files /dev/null and b/docs/images/AfterMatch.png differ
diff --git a/docs/images/AlternativeUi.png b/docs/images/AlternativeUi.png
new file mode 100644
index 00000000000..7b08a15c435
Binary files /dev/null and b/docs/images/AlternativeUi.png differ
diff --git a/docs/images/ArchitectureSequenceDiagram.png b/docs/images/ArchitectureSequenceDiagram.png
index 2f1346869d0..838fa81ed17 100644
Binary files a/docs/images/ArchitectureSequenceDiagram.png and b/docs/images/ArchitectureSequenceDiagram.png differ
diff --git a/docs/images/BeforeMatch.png b/docs/images/BeforeMatch.png
new file mode 100644
index 00000000000..1c80a354e31
Binary files /dev/null and b/docs/images/BeforeMatch.png differ
diff --git a/docs/images/BuyerCard.png b/docs/images/BuyerCard.png
new file mode 100644
index 00000000000..2a31198985d
Binary files /dev/null and b/docs/images/BuyerCard.png differ
diff --git a/docs/images/DeleteCommandParserClasses.png b/docs/images/DeleteCommandParserClasses.png
new file mode 100644
index 00000000000..12b38e9143d
Binary files /dev/null and b/docs/images/DeleteCommandParserClasses.png differ
diff --git a/docs/images/DeleteSequenceDiagram.png b/docs/images/DeleteSequenceDiagram.png
index fa327b39618..b503a32ca76 100644
Binary files a/docs/images/DeleteSequenceDiagram.png and b/docs/images/DeleteSequenceDiagram.png differ
diff --git a/docs/images/InterpretGUI.png b/docs/images/InterpretGUI.png
new file mode 100644
index 00000000000..ae1a8d30a13
Binary files /dev/null and b/docs/images/InterpretGUI.png differ
diff --git a/docs/images/LogicClassDiagram.png b/docs/images/LogicClassDiagram.png
index 9e9ba9f79e5..37c950839ff 100644
Binary files a/docs/images/LogicClassDiagram.png and b/docs/images/LogicClassDiagram.png differ
diff --git a/docs/images/MatchCommandIllustration1.png b/docs/images/MatchCommandIllustration1.png
new file mode 100644
index 00000000000..41744f26715
Binary files /dev/null and b/docs/images/MatchCommandIllustration1.png differ
diff --git a/docs/images/MatchCommandIllustration2.png b/docs/images/MatchCommandIllustration2.png
new file mode 100644
index 00000000000..a0d4ce3026a
Binary files /dev/null and b/docs/images/MatchCommandIllustration2.png differ
diff --git a/docs/images/MatchCommandSequenceDiagram1.png b/docs/images/MatchCommandSequenceDiagram1.png
new file mode 100644
index 00000000000..25899c1870c
Binary files /dev/null and b/docs/images/MatchCommandSequenceDiagram1.png differ
diff --git a/docs/images/MatchCommandSequenceDiagram2.png b/docs/images/MatchCommandSequenceDiagram2.png
new file mode 100644
index 00000000000..bc1bec45ca4
Binary files /dev/null and b/docs/images/MatchCommandSequenceDiagram2.png differ
diff --git a/docs/images/ModelBuyerObjectImplementation.png b/docs/images/ModelBuyerObjectImplementation.png
new file mode 100644
index 00000000000..6842f032619
Binary files /dev/null and b/docs/images/ModelBuyerObjectImplementation.png differ
diff --git a/docs/images/ModelClassDiagram.png b/docs/images/ModelClassDiagram.png
index 04070af60d8..a19b6ac3e56 100644
Binary files a/docs/images/ModelClassDiagram.png and b/docs/images/ModelClassDiagram.png differ
diff --git a/docs/images/ModelOrderObjectImplementation.png b/docs/images/ModelOrderObjectImplementation.png
new file mode 100644
index 00000000000..2a2fc4a6bae
Binary files /dev/null and b/docs/images/ModelOrderObjectImplementation.png differ
diff --git a/docs/images/ModelPetObjectImplementation.png b/docs/images/ModelPetObjectImplementation.png
new file mode 100644
index 00000000000..888228cb1a2
Binary files /dev/null and b/docs/images/ModelPetObjectImplementation.png differ
diff --git a/docs/images/ModelSupplierObjectImplementation.png b/docs/images/ModelSupplierObjectImplementation.png
new file mode 100644
index 00000000000..7fd1919401a
Binary files /dev/null and b/docs/images/ModelSupplierObjectImplementation.png differ
diff --git a/docs/images/OldUiClassDiagram.png b/docs/images/OldUiClassDiagram.png
new file mode 100644
index 00000000000..85cd6f5ef99
Binary files /dev/null and b/docs/images/OldUiClassDiagram.png differ
diff --git a/docs/images/PetCode Logo.png b/docs/images/PetCode Logo.png
new file mode 100644
index 00000000000..ea7b6e231a3
Binary files /dev/null and b/docs/images/PetCode Logo.png differ
diff --git a/docs/images/PopupWindowActivityDiagram.png b/docs/images/PopupWindowActivityDiagram.png
new file mode 100644
index 00000000000..6f7788236cc
Binary files /dev/null and b/docs/images/PopupWindowActivityDiagram.png differ
diff --git a/docs/images/PopupWindowClassDiagram.png b/docs/images/PopupWindowClassDiagram.png
new file mode 100644
index 00000000000..f9a9f34467a
Binary files /dev/null and b/docs/images/PopupWindowClassDiagram.png differ
diff --git a/docs/images/PopupWindowSequenceDiagram1.png b/docs/images/PopupWindowSequenceDiagram1.png
new file mode 100644
index 00000000000..ab916013449
Binary files /dev/null and b/docs/images/PopupWindowSequenceDiagram1.png differ
diff --git a/docs/images/PopupWindowSequenceDiagram2.png b/docs/images/PopupWindowSequenceDiagram2.png
new file mode 100644
index 00000000000..19e990cf4e1
Binary files /dev/null and b/docs/images/PopupWindowSequenceDiagram2.png differ
diff --git a/docs/images/SortCommandParserClasses.png b/docs/images/SortCommandParserClasses.png
new file mode 100644
index 00000000000..001faef6b5e
Binary files /dev/null and b/docs/images/SortCommandParserClasses.png differ
diff --git a/docs/images/StartUIPage.png b/docs/images/StartUIPage.png
new file mode 100644
index 00000000000..834e20edd7a
Binary files /dev/null and b/docs/images/StartUIPage.png differ
diff --git a/docs/images/StorageClassDiagram-0.png b/docs/images/StorageClassDiagram-0.png
new file mode 100644
index 00000000000..015bd8d15a3
Binary files /dev/null and b/docs/images/StorageClassDiagram-0.png differ
diff --git a/docs/images/StorageClassDiagram.png b/docs/images/StorageClassDiagram.png
index 2533a5c1af0..3a66b64dca0 100644
Binary files a/docs/images/StorageClassDiagram.png and b/docs/images/StorageClassDiagram.png differ
diff --git a/docs/images/Ui.png b/docs/images/Ui.png
index 5bd77847aa2..a04a5f35e52 100644
Binary files a/docs/images/Ui.png and b/docs/images/Ui.png differ
diff --git a/docs/images/UiClassDiagram.png b/docs/images/UiClassDiagram.png
index 785e04dbab4..2d902225135 100644
Binary files a/docs/images/UiClassDiagram.png and b/docs/images/UiClassDiagram.png differ
diff --git a/docs/images/UiClassDiagram1.png b/docs/images/UiClassDiagram1.png
new file mode 100644
index 00000000000..7399e6c6d6e
Binary files /dev/null and b/docs/images/UiClassDiagram1.png differ
diff --git a/docs/images/UndoRedoState0.png b/docs/images/UndoRedoState0.png
index 8f7538cd884..74d86faa697 100644
Binary files a/docs/images/UndoRedoState0.png and b/docs/images/UndoRedoState0.png differ
diff --git a/docs/images/UndoRedoState1.png b/docs/images/UndoRedoState1.png
index df9908d0948..ded288e83bb 100644
Binary files a/docs/images/UndoRedoState1.png and b/docs/images/UndoRedoState1.png differ
diff --git a/docs/images/UndoRedoState2.png b/docs/images/UndoRedoState2.png
index 36519c1015b..d1f2fbb5da5 100644
Binary files a/docs/images/UndoRedoState2.png and b/docs/images/UndoRedoState2.png differ
diff --git a/docs/images/UndoRedoState3.png b/docs/images/UndoRedoState3.png
index 19959d01712..daac82c10fe 100644
Binary files a/docs/images/UndoRedoState3.png and b/docs/images/UndoRedoState3.png differ
diff --git a/docs/images/UndoRedoState4.png b/docs/images/UndoRedoState4.png
index 4c623e4f2c5..e6a792a25dd 100644
Binary files a/docs/images/UndoRedoState4.png and b/docs/images/UndoRedoState4.png differ
diff --git a/docs/images/UndoRedoState5.png b/docs/images/UndoRedoState5.png
index 84ad2afa6bd..fc0c010039d 100644
Binary files a/docs/images/UndoRedoState5.png and b/docs/images/UndoRedoState5.png differ
diff --git a/docs/images/boredcoco.png b/docs/images/boredcoco.png
new file mode 100644
index 00000000000..b3158ad64ff
Binary files /dev/null and b/docs/images/boredcoco.png differ
diff --git a/docs/images/elizabethhky.png b/docs/images/elizabethhky.png
new file mode 100644
index 00000000000..15e33dc110c
Binary files /dev/null and b/docs/images/elizabethhky.png differ
diff --git a/docs/images/faithchua.png b/docs/images/faithchua.png
new file mode 100644
index 00000000000..b3158ad64ff
Binary files /dev/null and b/docs/images/faithchua.png differ
diff --git a/docs/images/helpMessage.png b/docs/images/helpMessage.png
deleted file mode 100644
index b1f70470137..00000000000
Binary files a/docs/images/helpMessage.png and /dev/null differ
diff --git a/docs/images/helpWindow.png b/docs/images/helpWindow.png
new file mode 100644
index 00000000000..971cac48230
Binary files /dev/null and b/docs/images/helpWindow.png differ
diff --git a/docs/images/hongyi6328.png b/docs/images/hongyi6328.png
new file mode 100644
index 00000000000..e487bef52a3
Binary files /dev/null and b/docs/images/hongyi6328.png differ
diff --git a/docs/images/matchScoreCalculationFormula.png b/docs/images/matchScoreCalculationFormula.png
new file mode 100644
index 00000000000..e353b2ba06e
Binary files /dev/null and b/docs/images/matchScoreCalculationFormula.png differ
diff --git a/docs/images/uniqueIdIllustration.png b/docs/images/uniqueIdIllustration.png
new file mode 100644
index 00000000000..9eae9b63060
Binary files /dev/null and b/docs/images/uniqueIdIllustration.png differ
diff --git a/docs/images/wu-lezheng.png b/docs/images/wu-lezheng.png
new file mode 100644
index 00000000000..13db2cad426
Binary files /dev/null and b/docs/images/wu-lezheng.png differ
diff --git a/docs/images/wweqg.png b/docs/images/wweqg.png
new file mode 100644
index 00000000000..be5bf41a5b3
Binary files /dev/null and b/docs/images/wweqg.png differ
diff --git a/docs/index.md b/docs/index.md
index 7601dbaad0d..c1fb3c87436 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -1,17 +1,16 @@
---
layout: page
-title: AddressBook Level-3
+title: PetCode
---
-[![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/se-edu/addressbook-level3/branch/master/graph/badge.svg)](https://codecov.io/gh/se-edu/addressbook-level3)
-
+[![CI Status](https://github.com/AY2223S1-CS2103T-T09-2/tp/workflows/Java%20CI/badge.svg)](https://github.com/se-edu/addressbook-level3/actions)
+[![codecov](https://codecov.io/gh/AY2223S1-CS2103T-T09-2/tp/branch/master/graph/badge.svg?token=F6VVPXKC9C)](https://codecov.io/gh/AY2223S1-CS2103T-T09-2/tp)
![Ui](images/Ui.png)
-**AddressBook is a desktop application for managing your contact details.** While it has a GUI, most of the user interactions happen using a CLI (Command Line Interface).
+**PetCode is a software app that aims to facilitate better working experience and boost business management efficiency for pet sale coordinators.** While it has a GUI, most of the user interactions happen using a CLI (Command Line Interface).
-* If you are interested in using AddressBook, head over to the [_Quick Start_ section of the **User Guide**](UserGuide.html#quick-start).
-* If you are interested about developing AddressBook, the [**Developer Guide**](DeveloperGuide.html) is a good place to start.
+* If you are interested in using PetCode, head over to the [_Quick Start_ section of the **User Guide**](UserGuide.html#quick-start).
+* If you are interested about developing PetCode, the [**Developer Guide**](DeveloperGuide.html) is a good place to start.
**Acknowledgements**
diff --git a/docs/team/boredcoco.md b/docs/team/boredcoco.md
new file mode 100644
index 00000000000..7eeb22c6120
--- /dev/null
+++ b/docs/team/boredcoco.md
@@ -0,0 +1,57 @@
+---
+layout: page
+title: Faith Chua's Project Portfolio Page
+---
+
+### Project: PetCode
+
+PetCode - is a desktop address book application used for coordinating pet deliveries between Pet Suppliers and Pet Customers.
+
+Given below are my contributions to the project.
+
+* **New Feature**: *Filter for relevant Pets*.
+ * What it does: *Using specific attributes, the user can find Pets matching those attributes*.
+ * Justification: *The user may want to take a quick look at Pets that have specific attributes so that he or she can bulk buy from a Supplier*
+ * Highlights: *This feature supports entering multiple fields*.
+
+* **New Feature**: *Filter for relevant Orders*.
+ * What it does: *Using specific attributes, the user can find Orders matching those attributes*.
+ * Justification: *The user may want to take a quick look at Orders that have specific attributes so that he or she can have an overview of similar orders.*
+ * Highlights: *This feature supports entering multiple fields*.
+
+* **Code contributed**: [RepoSense link](https://nus-cs2103-ay2223s1.github.io/tp-dashboard/?search=boredcoco&breakdown=true)
+
+* **Functionality**: Predicates
+ * Wrote Predicates (ie. PetNameContainsKeywordsPredicate) for Find and Filter functions
+ * Predicates pertain to Buyers, Deliverers, Suppliers, Pets and Orders
+ * These predicates help in the implementation of Find and Filter commands.
+
+* **Functionality**: Implemented some parser utility methods for predicates.
+ * Wrote PredicateParser class which generates Predicates pertaining to Buyer, Suppliers, Deliverers, Pets or Orders from the user input.
+
+* **Project management**:
+ * *Managed testing and writing test code [\#280](https://github.com/AY2223S1-CS2103T-T09-2/tp/pull/280#issue-1428340017)*.
+
+* **Enhancements to existing features**:
+ * Find a Buyer, Supplier or Deliver instead of simply finding a person.
+
+* **Documentation**:
+ * User Guide:
+ * Contributed to the "Finding a Contact using Keywords" section of the User guide.
+ * This includes the following sub-segments:
+ * Finding a Buyer
+ * Finding a Supplier
+ * Finding a Deliverer
+ * Contributed to the "Filter lists by attributes" section of the User guide.
+ * This includes the following sub-segments:
+ * Filtering Orders
+ * Filtering Pets
+ * Developer Guide:
+ * Contributed to explaining how the Logic works.
+ * Added use cases relevant to the features implemented by me.
+ * Added the content page of the Developer Guide.
+
+* **Community**:
+ * Reported bugs and suggestions for other teams in the class (examples: [/#4](https://github.com/boredcoco/ped/issues/1#issue-1426879221).)
+ * Most of the bugs were found through writing JUnit tests.
+ * Some manual testing was done to ensure that UI worked fine.
diff --git a/docs/team/elizabethhky.md b/docs/team/elizabethhky.md
new file mode 100644
index 00000000000..c18d51105d0
--- /dev/null
+++ b/docs/team/elizabethhky.md
@@ -0,0 +1,54 @@
+---
+layout: page
+title: Hong Ker Yen Elizabeth's Project Portfolio Page
+---
+
+### Project: PetCode
+
+PetCode is a software app that aims to facilitate better working experience and boost business management efficiency
+for pet sale coordinators. The user interacts with it using a CLI, and it has a GUI created with JavaFX. It is written
+in Java, and has about 30 kLoC.
+
+Given below are my contributions to the project.
+
+* **New Feature**: Extended the Delete Command to three categories: Delete Buyer Command, Delete Supplier Command and Delete Deliverer Command.
+ * What it does: allows the user to delete different types of contacts at the specified index.
+ * Justification: This allows the user to delete contacts that have become outdated.
+ * Credits: The code was inspired by the original code given in AB3.
+
+* **New Feature**: Extended the Delete Command for two more categories: Delete Order Command and Delete Pet Command.
+ * What it does: allows the user to delete an order or pet at the specified index.
+ * Justification: This allows the user to delete orders that have been completed and pets that are no longer available for sale.
+ * Credits: The code was inspired by the original code given in AB3.
+
+* **Functionality**: Added the classes `UniqueOrderIdPredicate` and `UniquePetIdPredicate`.
+ * What it does: these classes increases testability when testing for unique Orders and unique Pets.
+ * Justification: Orders and Pets can easily be distinguished by their UniqueId. Hence, when testing for a unique Order or Pet, their UniqueId can be used.
+
+* **Code contributed**: [RepoSense link](https://nus-cs2103-ay2223s1.github.io/tp-dashboard/?search=elizabethhky&breakdown=true&sort=groupTitle&sortWithin=title&since=2022-09-16&timeframe=commit&mergegroup=&groupSelect=groupByRepos&checkedFileTypes=docs~functional-code~test-code~other)
+
+* **Project management**:
+ * Kept track and notified teammates of important deadlines.
+ * Updated demo screenshots for each version release.
+
+* **Enhancements to existing features**:
+ * Wrote additional tests for existing features and json files to increase coverage by 6.10% (Pull request [#140](https://github.com/AY2223S1-CS2103T-T09-2/tp/pull/140)).
+
+* **Documentation**:
+ * User Guide:
+ * Added an introduction section to provide an overview of our application to new users: [#282](https://github.com/AY2223S1-CS2103T-T09-2/tp/pull/282/files), [#315](https://github.com/AY2223S1-CS2103T-T09-2/tp/pull/315)
+ * Added documentation for the feature `delete`: [#191](https://github.com/AY2223S1-CS2103T-T09-2/tp/pull/191/files)
+ * Added a table of contents for easier navigability: [#191](https://github.com/AY2223S1-CS2103T-T09-2/tp/pull/191/files)
+ * Did cosmetic tweaks and proofread the entire user guide to check for typos and consistent tone: [#191](https://github.com/AY2223S1-CS2103T-T09-2/tp/pull/191/files), [#285](https://github.com/AY2223S1-CS2103T-T09-2/tp/pull/285/files)
+ * Developer Guide:
+ * Updated the `Model` Component: [#215](https://github.com/AY2223S1-CS2103T-T09-2/tp/pull/215/files)
+ * Added more UML diagrams for `MatchCommand`, `Logic` component: [#368](https://github.com/AY2223S1-CS2103T-T09-2/tp/pull/368)
+ * Proofread the entire Developer Guide to check for typos and consistent tone: [#368](https://github.com/AY2223S1-CS2103T-T09-2/tp/pull/368)
+ * Added the `Appendix: Effort` section: [#368](https://github.com/AY2223S1-CS2103T-T09-2/tp/pull/368)
+
+* **Community**:
+ * PRs reviewed (with non-trivial review comments): [#137](https://github.com/AY2223S1-CS2103T-T09-2/tp/pull/137)
+ * Contributed to forum discussions (examples: [#157](https://github.com/nus-cs2103-AY2223S1/forum/issues/157)).
+
+* **Tools**:
+ * Used PlantUML to add more UML diagrams in the developer guide.
diff --git a/docs/team/hongyi6328.md b/docs/team/hongyi6328.md
new file mode 100644
index 00000000000..2d04a3306ca
--- /dev/null
+++ b/docs/team/hongyi6328.md
@@ -0,0 +1,88 @@
+---
+layout: page
+title: Huang Hongyi's Project Portfolio Page
+---
+
+### Project: PetCode
+* **New Feature**: Extended the add person command to three categories: add buyer, deliverer command and supplier command.
+ * What it does: allows the user to add persons according to their roles.
+ * Justification: This feature is the core feature of this app since all other features are based on it. The user
+ cannot do further manipulation of data without adding it.
+ * Highlights: This enhancement defines the paradigm of operations on contacts. That is, every person category has
+ its
+ own command word extension for every command, such as `add-s` and `delete-b`. It guides subsequent implementations
+ of other commands.
+
+* **New Feature**: Added the add order command and add pet command.
+ * What it does: allows the user to add an order to a buyer and add a pet to a supplier. Even more convenient, the
+ user
+ can choose to add as many orders as possible when adding a buyer, or add as many pets as possible when adding a
+ supplier.
+ * Justification: This helps the user organise his/her business by keeping track of orders placed and pets available
+ for sale.
+ * Highlights: There are a tremendous number of prefixes and attributes to handle, which was not easy.
+
+* **New Feature**: Added the match command.
+ * What it does: allow user to find out which pet for sale is the best fit for an order placed by a buyer.
+ * Justification: To maximise utility and profit, the user needs to find out the most suitable pet to sell to a buyer
+ according to the buyer's demand.
+ * Highlights: The algorithm is a score evaluation algorithm that involves some complex calculations. The weight of
+ each field is carefully chosen.
+
+* **Functionality**: Implemented many parser utility methods.
+ * What it does: provides convenient utility methods to parse strings to other objects and validate data by a variety
+ of rules.
+ * Justification: Many commands rely on and make use of these methods for convenience, such as the add commands, the
+ edit commands, the find commands and the filter commands.
+ * Highlights: There are many constraints to consider. For example, some data cannot be negative, some can only be
+ alphanumeric, and some cannot be blank. Multiplicity should be well considered too.
+
+* **Functionality**: Wrote data models.
+ * What it does: these data models, such as `Pet`, `Age`, `UniqueOrderList`, and `DateOfBirth` abstract real-world
+ objects and provide computational paradigms to mimic their interactions.
+ * Justification: Without these data models, it would be extremely troublesome to manipulate data.
+ * Highlights: The SOLID principles and OOP were employed thoroughly.
+* **Functionality**: Added the unique ID system.
+* **Functionality**: Discovered a variety of bugs and fixed them. For
+ examples, [\#308](https://github.com/AY2223S1-CS2103T-T09-2/tp/pull/308)
+ , [\#304](https://github.com/AY2223S1-CS2103T-T09-2/tp/pull/304)
+ , [\#299](https://github.com/AY2223S1-CS2103T-T09-2/tp/pull/299)
+ , [\#296](https://github.com/AY2223S1-CS2103T-T09-2/tp/pull/296)
+* **Code
+ contributed**: [RepoSense link](https://nus-cs2103-ay2223s1.github.io/tp-dashboard/?search=&sort=totalCommits%20dsc&sortWithin=title&timeframe=commit&mergegroup=&groupSelect=groupByRepos&breakdown=true&checkedFileTypes=docs~functional-code~test-code~other&since=2022-09-16&tabOpen=true&tabType=zoom&zA=Hongyi6328&zR=AY2223S1-CS2103T-T09-2%2Ftp%5Bmaster%5D&zACS=215.92310030395137&zS=2022-09-16&zFS=&zU=2022-11-01&zMG=false&zFTF=commit&zFGS=groupByRepos&zFR=false)
+* **Project management**:
+ * Managed releases `v1.2` - `v1.3(trial)` (2 releases) on GitHub.
+ * Assigned teammates to different issues and kept track of their progress.
+ * Maintained and updated the official and unofficial meeting minutes after every meeting.
+ * Managed milestones, changed their due dates, and closed them to wrap-up.
+ * Did final submission of the JAR file, the UG, the DG, and the PPP.
+
+* **Enhancements to existing features**:
+ * Let the GUI window fit different screen sizes (Pull
+ requests [\#296](https://github.com/AY2223S1-CS2103T-T09-2/tp/pull/296))
+ * Deleted useless classes like `AddCommandParser` and decoupled some classes for higher robustness.
+
+* **Documentation**:
+ * User Guide:
+ * Adding a buyer, Adding a deliverer, Adding a supplier, Adding a pet to a supplier, Adding an order to a buyer,
+ Prefix Summary, FAQs, Other miscellaneous parts and proofreading
+ * Developer Guide:
+ * Target user profile, Value proposition, User stories, Use cases, Match command implementation, Unique ID
+ implementation, Other miscellaneous parts and proofreading
+
+* **Community**:
+ * Created the team's organization and team repo
+ * Managed issues and allocated tasks to members
+ * Set up CodeCov repo
+ * PRs reviewed (with non-trivial review comments): [\#145](https://github.com/AY2223S1-CS2103T-T09-2/tp/pull/145)
+ , [\#174](https://github.com/AY2223S1-CS2103T-T09-2/tp/pull/115)
+ * Contributed to forum discussions (examples: [\#153](https://github.com/nus-cs2103-AY2223S1/forum/issues/153)
+ , [\#73](https://github.com/nus-cs2103-AY2223S1/forum/issues/73))
+ * Reported bugs and suggestions for other teams in the class (
+ examples: [\#183](https://github.com/AY2223S1-CS2103T-W17-3/tp/issues/183)
+ , [\#187](https://github.com/AY2223S1-CS2103T-W17-3/tp/issues/187)
+ , [\#176](https://github.com/AY2223S1-CS2103T-W17-3/tp/issues/176)
+ , [\#172](https://github.com/AY2223S1-CS2103T-W17-3/tp/issues/172))
+
+* **Tools**:
+ * Used JavaFX to develop the UI.
diff --git a/docs/team/johndoe.md b/docs/team/johndoe.md
deleted file mode 100644
index 773a07794e2..00000000000
--- a/docs/team/johndoe.md
+++ /dev/null
@@ -1,46 +0,0 @@
----
-layout: page
-title: John Doe's Project Portfolio Page
----
-
-### Project: AddressBook Level 3
-
-AddressBook - Level 3 is a desktop address book application used for teaching Software Engineering principles. The user interacts with it using a CLI, and it has a GUI created with JavaFX. It is written in Java, and has about 10 kLoC.
-
-Given below are my contributions to the project.
-
-* **New Feature**: Added the ability to undo/redo previous commands.
- * What it does: allows the user to undo all previous commands one at a time. Preceding undo commands can be reversed by using the redo command.
- * Justification: This feature improves the product significantly because a user can make mistakes in commands and the app should provide a convenient way to rectify them.
- * Highlights: This enhancement affects existing commands and commands to be added in future. It required an in-depth analysis of design alternatives. The implementation too was challenging as it required changes to existing commands.
- * Credits: *{mention here if you reused any code/ideas from elsewhere or if a third-party library is heavily used in the feature so that a reader can make a more accurate judgement of how much effort went into the feature}*
-
-* **New Feature**: Added a history command that allows the user to navigate to previous commands using up/down keys.
-
-* **Code contributed**: [RepoSense link]()
-
-* **Project management**:
- * Managed releases `v1.3` - `v1.5rc` (3 releases) on GitHub
-
-* **Enhancements to existing features**:
- * Updated the GUI color scheme (Pull requests [\#33](), [\#34]())
- * Wrote additional tests for existing features to increase coverage from 88% to 92% (Pull requests [\#36](), [\#38]())
-
-* **Documentation**:
- * User Guide:
- * Added documentation for the features `delete` and `find` [\#72]()
- * Did cosmetic tweaks to existing documentation of features `clear`, `exit`: [\#74]()
- * Developer Guide:
- * Added implementation details of the `delete` feature.
-
-* **Community**:
- * PRs reviewed (with non-trivial review comments): [\#12](), [\#32](), [\#19](), [\#42]()
- * Contributed to forum discussions (examples: [1](), [2](), [3](), [4]())
- * Reported bugs and suggestions for other teams in the class (examples: [1](), [2](), [3]())
- * Some parts of the history feature I added was adopted by several other class mates ([1](), [2]())
-
-* **Tools**:
- * Integrated a third party library (Natty) to the project ([\#42]())
- * Integrated a new Github plugin (CircleCI) to the team repo
-
-* _{you can add/remove categories in the list above}_
diff --git a/docs/team/wu-lezheng.md b/docs/team/wu-lezheng.md
new file mode 100644
index 00000000000..3a60f73c1de
--- /dev/null
+++ b/docs/team/wu-lezheng.md
@@ -0,0 +1,71 @@
+---
+layout: page
+title: Wu Lezheng's Project Portfolio Page
+---
+
+### Project: PetCode
+
+PetCode is a software app that aims to facilitate better working experience and boost business management efficiency for pet sale coordinators.
+
+Given below are my contributions to the project.
+
+* **Functionality**: Added the `order` package to the `model` component. (Pull request: [#82](https://github.com/AY2223S1-CS2103T-T09-2/tp/pull/82))
+ * What it does: Added an `Order` class and its subcomponents.
+ * Justification: These models lay the foundation so that existing and added operations/commands could be performed using these models.
+ * Highlights: Some of the SOLID principles of OOP are applied in these classes.
+
+* **Functionality**: Extended `person` to different categories. (Pull request: [#82](https://github.com/AY2223S1-CS2103T-T09-2/tp/pull/82))
+ * What it does: Extended the `Person` class into `Buyer`, `Supplier`, and `Deliverer`, with their respective attributes.
+ * Justification: These models lay the foundation so that existing and added operations/commands could be performed on them.
+ * Highlights: Some of the SOLID principles of OOP are applied in these classes.
+
+* **New Feature**: Added a popup window for adding command. (Pull request: [#159](https://github.com/AY2223S1-CS2103T-T09-2/tp/pull/159))
+ * What it is about: Added a popup window with prompt text for adding buyers with orders and suppliers with pets, without the need to input any prefixes.
+ * Justification: There is repetitive entering of multiple indexes when the users want to add a buyer with orders or to add a supplier with pets, which is very demanding in terms of memorisation.
+ * Highlights: The popup window is designed to improve the user experience (UX), with keyboard shortcuts and prompt texts. It also shows how UI, model and logic components can be linked.
+
+* **New Feature**: Extended the `EditCommand` (Pull request: [#205](https://github.com/AY2223S1-CS2103T-T09-2/tp/pull/205))
+ * What it does: Extended the `EditCommand` to `EditBuyerCommand`, `EditDelivererommand` and `EditSupplierCommand`.
+ * Justification: `Buyer`, `Deliverer` and `Supplierr` can have different attributes. Making a separate `EditCommand` for each of them allows customised editing even more distinct attributes are added to them in the future.
+ * Highlights: This makes use of polymorphism.
+
+* **Code contributed**: [RepoSense link](https://nus-cs2103-ay2223s1.github.io/tp-dashboard/?search=wu-lezheng&breakdown=true&sort=groupTitle&sortWithin=title&since=2022-09-16&timeframe=commit&mergegroup=&groupSelect=groupByRepos&checkedFileTypes=docs~functional-code~test-code~other&tabOpen=true&tabType=authorship&tabAuthor=Wu-Lezheng&tabRepo=AY2223S1-CS2103T-T09-2%2Ftp%5Bmaster%5D&authorshipIsMergeGroup=false&authorshipFileTypes=docs~functional-code~test-code&authorshipIsBinaryFileTypeChecked=false&authorshipIsIgnoredFilesChecked=false)
+
+* **Project management**:
+ * Managed releases `v1.3` on GitHub ([Link to v1.3 release](https://github.com/AY2223S1-CS2103T-T09-2/tp/releases/tag/v1.3.1))
+ * Recorded and managed the majority of the meeting discussions in the meeting minutes in the Google Drive folder.
+ * Created and assigned issues to team members on GitHub.
+ * Created labels and categorised issues on GitHub.
+
+* **Enhancements to existing features**:
+ * Updated the style of GUI and its layout. (Pull request: [#142](https://github.com/AY2223S1-CS2103T-T09-2/tp/pull/142))
+ * Categorised all Java classes into their respective packages. (Pull request: [#205](https://github.com/AY2223S1-CS2103T-T09-2/tp/pull/205))
+ * Wrote additional tests to increase test coverage.
+ * Fixed several bugs. (Pull requests: [#325](https://github.com/AY2223S1-CS2103T-T09-2/tp/pull/325), [#362](https://github.com/AY2223S1-CS2103T-T09-2/tp/pull/362))
+
+* **Documentation**:
+ * User Guide:
+ * Added documentation for the feature: `Adding a person with a popup window`. (Pull request: [#159](https://github.com/AY2223S1-CS2103T-T09-2/tp/pull/159))
+ * Added documentation for the feature: `Editing attributes of a contact`. (Pull request: [#205](https://github.com/AY2223S1-CS2103T-T09-2/tp/pull/205))
+ * Added documentation for the feature: `Listing contacts or items`. (Pull request: [#207](https://github.com/AY2223S1-CS2103T-T09-2/tp/pull/207))
+ * Proofread the whole UG.
+ (Pull requests: [#356](https://github.com/AY2223S1-CS2103T-T09-2/tp/pull/356), [#364](https://github.com/AY2223S1-CS2103T-T09-2/tp/pull/364), [#365](https://github.com/AY2223S1-CS2103T-T09-2/tp/pull/365))
+ * Developer Guide:
+ * Updated the `UI component`. (Pull request: [#180](https://github.com/AY2223S1-CS2103T-T09-2/tp/pull/180))
+ * Added implementation of `Display of person list`. (Pull request: [#180](https://github.com/AY2223S1-CS2103T-T09-2/tp/pull/180))
+ * Added implementation of `Pop-up window for add command`. (Pull request: [#204](https://github.com/AY2223S1-CS2103T-T09-2/tp/pull/204))
+
+* **Community**:
+ * PRs reviewed (with non-trivial comments):
+ [\#156](https://github.com/AY2223S1-CS2103T-T09-2/tp/pull/156#discussion_r1000077198),
+ [#352](https://github.com/AY2223S1-CS2103T-T09-2/tp/pull/352).
+ * Reported bugs and suggestions for other teams in the class:
+ [#165](https://github.com/AY2223S1-CS2103T-W08-2/tp/issues/165),
+ [#170](https://github.com/AY2223S1-CS2103T-W08-2/tp/issues/170),
+ [#178](https://github.com/AY2223S1-CS2103T-W08-2/tp/issues/178),
+ [#186](https://github.com/AY2223S1-CS2103T-W08-2/tp/issues/186),
+ [#195](https://github.com/AY2223S1-CS2103T-W08-2/tp/issues/195).
+
+* **Tools**:
+ * Used JavaFX and Scene Builder to modify the UI.
+ * Used PlantUML to add more UML diagrams in the developer guide.
diff --git a/docs/team/wweqg.md b/docs/team/wweqg.md
new file mode 100644
index 00000000000..21b60d4e689
--- /dev/null
+++ b/docs/team/wweqg.md
@@ -0,0 +1,50 @@
+---
+layout: page
+title: Zhang Weiqiang's Project Portfolio Page
+---
+
+### Project: PetCode
+
+PetCode is a software app that aims to facilitate better working experience and boost business management efficiency for pet sale coordinators.
+
+Given below are my contributions to the project.
+
+* **New Feature**: Added the ability to sort the items in buyer/supplier/deliverer/order/pet list.
+ * What it does: It allows user to sort different list by the supported keys in ascending order.
+ * Justification: This feature improves the product significantly because originally any new order/pet/contact added to the program will be automatically appended to the end of their respective list, there were no ways to reorder the items in the list. If the user wants to prioritize the orders that are more urgent, he/she has to scroll through the entire order list to manually compare and choose. Therefore, the application should provide a convenient way to save the hassle.
+ * Highlights: This feature supports entering multiple keys for sorting a single list. The later keys are used to break ties arise from sorting using previous keys. For instance, `sort pet height weight` will sort the pets by their heights, for two pets with the same height, their relative sequence will be decided by their weights.
+
+* **New Feature**: Added the ability to check which item belongs to which contact.
+ * What it does: It checks a contact at specified index, the application will display different windows for each list input. For `check buyer 1`, it will display the list of orders from buyer at buyer list index 1. For `check supplier 1`, it will display the list of pets from supplier at supplier list index 1. For `check order 1`, it will display the buyer of the order at order list index 1. For `check pet 1`, it will display the supplier of the pet at pet list index 1.
+ * Justification: This feature improves the product significantly because originally in the order list, the only buyer related information displayed is the name of the buyer. In order to locate the buyer of a particular order, the user has to memorise the name and navigate to the buyer list look for the matched name. This approach is undesirable and is unlikely to identify the correct buyer, as the user could misremember the names or there could be people with the same names. Therefore, the application should provide a convenient way to rectify the problem.
+ * Highlights: This feature changes the UI display to provide instant feedback to the user.
+
+
+* **Code contributed**: [RepoSense link](https://nus-cs2103-ay2223s1.github.io/tp-dashboard/?search=wweqg&breakdown=true&sort=groupTitle&sortWithin=title&since=2022-09-16&timeframe=commit&mergegroup=&groupSelect=groupByRepos&checkedFileTypes=docs~functional-code~test-code~other)
+
+* **Project management**:
+ * Update JavaCI and CodeCov badge [\#61](https://github.com/AY2223S1-CS2103T-T09-2/tp/pull/61) [\#62](https://github.com/AY2223S1-CS2103T-T09-2/tp/pull/62)
+ * Managed release `v1.3` on GitHub.
+
+* **Enhancements to existing features**:
+ * Added five unique lists in the application, added and updated relevant methods in logic, model, storage and other class to fit the changes [\#90](https://github.com/AY2223S1-CS2103T-T09-2/tp/pull/90) [\#94](https://github.com/AY2223S1-CS2103T-T09-2/tp/pull/94)
+ * Improved UI interactions for all commands. [\#352](https://github.com/AY2223S1-CS2103T-T09-2/tp/pull/352)
+ * Extended the list command to support five different lists [\#164](https://github.com/AY2223S1-CS2103T-T09-2/tp/pull/164)
+ * Extended the edit command to support three different lists [\#202](https://github.com/AY2223S1-CS2103T-T09-2/tp/pull/202)
+ * Fixed several bugs (examples: [\#222](https://github.com/AY2223S1-CS2103T-T09-2/tp/issues/222), [\#234](https://github.com/AY2223S1-CS2103T-T09-2/tp/issues/234), [\#237](https://github.com/AY2223S1-CS2103T-T09-2/tp/issues/237), [\#239](https://github.com/AY2223S1-CS2103T-T09-2/tp/issues/239), [\#244](https://github.com/AY2223S1-CS2103T-T09-2/tp/issues/244), [\#261](https://github.com/AY2223S1-CS2103T-T09-2/tp/issues/261), [\#262](https://github.com/AY2223S1-CS2103T-T09-2/tp/issues/262), [\#264](https://github.com/AY2223S1-CS2103T-T09-2/tp/issues/264), [\#265](https://github.com/AY2223S1-CS2103T-T09-2/tp/issues/265))
+
+* **Documentation**:
+ * User Guide:
+ * Added documentation for the features `list`, `sort` and `check` [\#177](https://github.com/AY2223S1-CS2103T-T09-2/tp/pull/177/files#diff-b50feaf9240709b6b02fb9584696b012c2a69feeba89e409952cc2f401f373fb)
+ * Developer Guide:
+ * Updated the UML diagram for storage package.
+
+* **Community**:
+ * PRs reviewed (with non-trivial review comments): [\#211](https://github.com/AY2223S1-CS2103T-T09-2/tp/issues/211) [\#305](https://github.com/AY2223S1-CS2103T-T09-2/tp/pull/305)
+ * Reported bugs and suggestions for other teams in the class (examples: [\#9](https://github.com/wweqg/ped/issues/9), [\#10](https://github.com/wweqg/ped/issues/10), [\#11](https://github.com/wweqg/ped/issues/11), [\#12](https://github.com/wweqg/ped/issues/12).)
+
+* **Tools**:
+ * Used JavaFX for UI related features.
+ * Used PlantUML to add more UML diagrams in the developer guide.
+
+
diff --git a/docs/tutorials/TracingCode.md b/docs/tutorials/TracingCode.md
index 4fb62a83ef6..29553f8f68b 100644
--- a/docs/tutorials/TracingCode.md
+++ b/docs/tutorials/TracingCode.md
@@ -201,7 +201,7 @@ Recall from the User Guide that the `edit` command has the format: `edit INDEX [
```
1. As suspected, `command#execute()` does indeed make changes to the `model` object. Specifically,
- * it uses the `setPerson()` method (defined in the interface `Model` and implemented in `ModelManager` as per the usual pattern) to update the person data.
+ * it uses the `setPerson()` method (defined in the interface `Model` and implemented in `ModelManager` as per the usual colorPattern) to update the person data.
* it uses the `updateFilteredPersonList` method to ask the `Model` to populate the 'filtered list' with _all_ persons.
FYI, The 'filtered list' is the list of persons resulting from the most recent operation that will be shown to the user immediately after. For the `edit` command, we populate it with all the persons so that the user can see the edited person along with all other persons. If this was a `find` command, we would be setting that list to contain the search results instead.
To provide some context, given below is the class diagram of the `Model` component. See if you can figure out where the 'filtered list' of persons is being tracked.
diff --git a/src/main/java/seedu/address/MainApp.java b/src/main/java/seedu/address/MainApp.java
index 4133aaa0151..f889c9df5c9 100644
--- a/src/main/java/seedu/address/MainApp.java
+++ b/src/main/java/seedu/address/MainApp.java
@@ -36,7 +36,7 @@
*/
public class MainApp extends Application {
- public static final Version VERSION = new Version(0, 2, 0, true);
+ public static final Version VERSION = new Version(1, 3, 1, true);
private static final Logger logger = LogsCenter.getLogger(MainApp.class);
@@ -79,14 +79,14 @@ private Model initModelManager(Storage storage, ReadOnlyUserPrefs userPrefs) {
try {
addressBookOptional = storage.readAddressBook();
if (!addressBookOptional.isPresent()) {
- logger.info("Data file not found. Will be starting with a sample AddressBook");
+ logger.info("Data file not found. Will be starting with a sample PetCode");
}
initialData = addressBookOptional.orElseGet(SampleDataUtil::getSampleAddressBook);
} catch (DataConversionException e) {
- logger.warning("Data file not in the correct format. Will be starting with an empty AddressBook");
+ logger.warning("Data file not in the correct format. Will be starting with an empty PetCode");
initialData = new AddressBook();
} catch (IOException e) {
- logger.warning("Problem while reading from the file. Will be starting with an empty AddressBook");
+ logger.warning("Problem while reading from the file. Will be starting with an empty PetCOde");
initialData = new AddressBook();
}
@@ -151,7 +151,7 @@ protected UserPrefs initPrefs(UserPrefsStorage storage) {
+ "Using default user prefs");
initializedPrefs = new UserPrefs();
} catch (IOException e) {
- logger.warning("Problem while reading from the file. Will be starting with an empty AddressBook");
+ logger.warning("Problem while reading from the file. Will be starting with an empty PetCode");
initializedPrefs = new UserPrefs();
}
@@ -167,7 +167,7 @@ protected UserPrefs initPrefs(UserPrefsStorage storage) {
@Override
public void start(Stage primaryStage) {
- logger.info("Starting AddressBook " + MainApp.VERSION);
+ logger.info("Starting PetCode " + MainApp.VERSION);
ui.start(primaryStage);
}
diff --git a/src/main/java/seedu/address/commons/core/GuiSettings.java b/src/main/java/seedu/address/commons/core/GuiSettings.java
index ba33653be67..c7ccc630496 100644
--- a/src/main/java/seedu/address/commons/core/GuiSettings.java
+++ b/src/main/java/seedu/address/commons/core/GuiSettings.java
@@ -1,6 +1,7 @@
package seedu.address.commons.core;
import java.awt.Point;
+import java.awt.Toolkit;
import java.io.Serializable;
import java.util.Objects;
@@ -10,8 +11,8 @@
*/
public class GuiSettings implements Serializable {
- private static final double DEFAULT_HEIGHT = 600;
- private static final double DEFAULT_WIDTH = 740;
+ private static final double DEFAULT_HEIGHT = Toolkit.getDefaultToolkit().getScreenSize().getHeight() * 0.9;
+ private static final double DEFAULT_WIDTH = Toolkit.getDefaultToolkit().getScreenSize().getWidth() * 0.9;
private final double windowWidth;
private final double windowHeight;
diff --git a/src/main/java/seedu/address/commons/core/Messages.java b/src/main/java/seedu/address/commons/core/Messages.java
index 1deb3a1e469..1795ed7575a 100644
--- a/src/main/java/seedu/address/commons/core/Messages.java
+++ b/src/main/java/seedu/address/commons/core/Messages.java
@@ -6,8 +6,18 @@
public class Messages {
public static final String MESSAGE_UNKNOWN_COMMAND = "Unknown command";
+ public static final String MESSAGE_ILLEGAL_VALUE = "Illegal value: ";
public static final String MESSAGE_INVALID_COMMAND_FORMAT = "Invalid command format! \n%1$s";
- public static final String MESSAGE_INVALID_PERSON_DISPLAYED_INDEX = "The person index provided is invalid";
+ public static final String MESSAGE_INVALID_PERSON_DISPLAYED_INDEX = "The index provided is invalid. "
+ + "It must be an unsigned whole number. Also, please count from 1 and check whether it is out of range.";
+ public static final String MESSAGE_MISSING_INDEX = "Missing index!\n";
public static final String MESSAGE_PERSONS_LISTED_OVERVIEW = "%1$d persons listed!";
+ public static final String MESSAGE_ORDERS_LISTED_OVERVIEW = "%1$d orders listed!";
+ public static final String MESSAGE_PETS_LISTED_OVERVIEW = "%1$d pets listed!";
+ public static final String INVALID_BUYER = "Index %1$s is not a buyer";
+ public static final String INVALID_SUPPLIER = "Index %1$s is not a supplier";
+ public static final String INVALID_DELIVERER = "Index %1$s is not a deliverer";
+ public static final String INVALID_ORDER = "Index %1$s is not an order";
+ public static final String INVALID_PET = "Index %1$s is not a pet";
}
diff --git a/src/main/java/seedu/address/commons/core/index/Index.java b/src/main/java/seedu/address/commons/core/index/Index.java
index 19536439c09..f4b7a593d40 100644
--- a/src/main/java/seedu/address/commons/core/index/Index.java
+++ b/src/main/java/seedu/address/commons/core/index/Index.java
@@ -9,7 +9,9 @@
* convert it back to an int if the index will not be passed to a different component again.
*/
public class Index {
- private int zeroBasedIndex;
+ public static final String MESSAGE_USAGE = "Index should be a non-negative whole number.";
+
+ private final int zeroBasedIndex;
/**
* Index can only be created by calling {@link Index#fromZeroBased(int)} or
diff --git a/src/main/java/seedu/address/commons/core/index/UniqueId.java b/src/main/java/seedu/address/commons/core/index/UniqueId.java
new file mode 100644
index 00000000000..f84bb4e5b6c
--- /dev/null
+++ b/src/main/java/seedu/address/commons/core/index/UniqueId.java
@@ -0,0 +1,39 @@
+package seedu.address.commons.core.index;
+
+/**
+ * Represents a unique id that does not change throughout the life cycle of an Object
+ */
+public class UniqueId implements Comparable {
+ private final String id;
+
+ /**
+ * Constructs a unique id object;
+ *
+ * @param id The string as the key for id.
+ */
+ public UniqueId(String id) {
+ this.id = id;
+ }
+
+ public String getIdToString() {
+ return this.id;
+ }
+
+ @Override
+ public int compareTo(UniqueId other) {
+ return this.id.compareTo(other.id);
+ }
+
+ @Override
+ public boolean equals(Object other) {
+ if (!(other instanceof UniqueId)) {
+ return false;
+ }
+ return this.id.equals(((UniqueId) other).id);
+ }
+
+ @Override
+ public int hashCode() {
+ return id.hashCode();
+ }
+}
diff --git a/src/main/java/seedu/address/commons/core/index/UniqueIdGenerator.java b/src/main/java/seedu/address/commons/core/index/UniqueIdGenerator.java
new file mode 100644
index 00000000000..1983de2c665
--- /dev/null
+++ b/src/main/java/seedu/address/commons/core/index/UniqueIdGenerator.java
@@ -0,0 +1,87 @@
+package seedu.address.commons.core.index;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * Generates a unique ID and increments the current ID.
+ */
+public class UniqueIdGenerator {
+
+ private static final char START = 'a';
+ private static final char BASE = 26;
+ private static final Set storedIdOrder = new HashSet<>();
+ private static final Set storedIdPet = new HashSet<>();
+ private final List currentId = new ArrayList<>();
+
+ /**
+ * Constructs a unique id generator starting from the base id.
+ */
+ public UniqueIdGenerator() {
+ currentId.add(START);
+ }
+
+ /**
+ * Returns the current id and increments.
+ *
+ * @return A unique ID.
+ */
+ public UniqueId next() {
+ StringBuilder sb = new StringBuilder();
+ currentId.forEach(x -> sb.insert(0, x));
+ String id = sb.toString();
+ increment();
+ return new UniqueId(id);
+ }
+
+ /**
+ * Adds a unique id to the storedIdPet
+ */
+ public static boolean addToStoredIdPet(UniqueId id) {
+ return storedIdPet.add(id);
+ }
+
+ /**
+ * Checks if the storedIdPet set contains a given id.
+ */
+ public static boolean storedIdPetContains(UniqueId id) {
+ return storedIdPet.contains(id);
+ }
+
+ /**
+ * Adds a unique id to the storedIdOrder.
+ */
+ public static boolean addToStoredIdOrder(UniqueId id) {
+ return storedIdOrder.add(id);
+ }
+
+ /**
+ * Checks if the storedIdOrder set contains a given id.
+ */
+ public static boolean storedIdOrderContains(UniqueId id) {
+ return storedIdOrder.contains(id);
+ }
+
+
+ private void increment() {
+ int idx = 0;
+ boolean carry = false;
+ do {
+ char cur = currentId.get(idx);
+ cur += 1;
+ if (cur == START + BASE) {
+ carry = true;
+ cur = START;
+ }
+ currentId.set(idx, cur);
+ if (carry) {
+ idx++;
+ }
+ } while (carry && idx < currentId.size());
+ if (carry && idx == currentId.size()) {
+ currentId.add(START);
+ }
+ }
+}
diff --git a/src/main/java/seedu/address/logic/Logic.java b/src/main/java/seedu/address/logic/Logic.java
index 92cd8fa605a..d74fe8dc1b3 100644
--- a/src/main/java/seedu/address/logic/Logic.java
+++ b/src/main/java/seedu/address/logic/Logic.java
@@ -4,25 +4,38 @@
import javafx.collections.ObservableList;
import seedu.address.commons.core.GuiSettings;
+import seedu.address.logic.commands.Command;
import seedu.address.logic.commands.CommandResult;
import seedu.address.logic.commands.exceptions.CommandException;
import seedu.address.logic.parser.exceptions.ParseException;
import seedu.address.model.ReadOnlyAddressBook;
-import seedu.address.model.person.Person;
+import seedu.address.model.order.Order;
+import seedu.address.model.person.Buyer;
+import seedu.address.model.person.Deliverer;
+import seedu.address.model.person.Supplier;
+import seedu.address.model.pet.Pet;
/**
- * API of the Logic component
+ * API of the Logic component.
*/
public interface Logic {
/**
* Executes the command and returns the result.
* @param commandText The command as entered by the user.
- * @return the result of the command execution.
+ * @return The result of the command execution.
* @throws CommandException If an error occurs during command execution.
* @throws ParseException If an error occurs during parsing.
*/
CommandResult execute(String commandText) throws CommandException, ParseException;
+ /**
+ * Executes the given command and returns the result.
+ * @param command The given command.
+ * @return The result of the command execution.
+ * @throws CommandException If an error occurs during command execution.
+ */
+ CommandResult executeGivenCommand(Command command) throws CommandException;
+
/**
* Returns the AddressBook.
*
@@ -30,8 +43,8 @@ public interface Logic {
*/
ReadOnlyAddressBook getAddressBook();
- /** Returns an unmodifiable view of the filtered list of persons */
- ObservableList getFilteredPersonList();
+ /** Returns an unmodifiable view of the filtered list of objects */
+ ObservableList