diff --git a/README.md b/README.md index 13f5c77403f..82e9585d33c 100644 --- a/README.md +++ b/README.md @@ -2,13 +2,14 @@ ![Ui](docs/images/Ui.png) -* This is **a sample project for Software Engineering (SE) students**.
+# Bogo Bogo +* This is an efficient CLI-based inventory management system that helps small business owners/entrepreneurs keep track it their inventory.
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. + * as an inventory tracker + * as a order checker +* This project is based on the AddressBook-Level3 project created by the [SE-EDU initiative](https://se-education.org). + * It is **written in OOP fashion**. It provides a **reasonably well-written** code base **bigger** (around 6 KLoC). * 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. +* It is named `Bogobogo` because it provides fast and efficient managing of inventory just like how bogosort is. +* For the detailed documentation of this project, see the **[BogoBogo Product Website](https://AY2122S1-CS2103-F10-2.github.io/tp)**. +* 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. diff --git a/build.gradle b/build.gradle index be2d2905dde..66af0399ec5 100644 --- a/build.gradle +++ b/build.gradle @@ -66,7 +66,11 @@ dependencies { } shadowJar { - archiveName = 'addressbook.jar' + archiveName = 'bogobogo.jar' +} + +run { + enableAssertions = true } defaultTasks 'clean', 'test' diff --git a/docs/AboutUs.md b/docs/AboutUs.md index 1c9514e966a..3e15f7de89e 100644 --- a/docs/AboutUs.md +++ b/docs/AboutUs.md @@ -1,6 +1,7 @@ --- layout: page title: About Us +parent: The Team --- We are a team based in the [School of Computing, National University of Singapore](http://www.comp.nus.edu.sg). @@ -9,51 +10,38 @@ You can reach us at the email `seer[at]comp.nus.edu.sg` ## Project team -### John Doe +### Bryan Wee Shun Yi - + -[[homepage](http://www.comp.nus.edu.sg/~damithch)] -[[github](https://github.com/johndoe)] -[[portfolio](team/johndoe.md)] - -* Role: Project Advisor - -### Jane Doe - - - -[[github](http://github.com/johndoe)] -[[portfolio](team/johndoe.md)] +[[github](http://github.com/bryanwee023)] * Role: Team Lead -* Responsibilities: UI +* Responsibilities: UI, Scheduling and Tracking, Git Expert -### Johnny Doe +### Hay Man Hnin Lwin - + -[[github](http://github.com/johndoe)] [[portfolio](team/johndoe.md)] +[[github](http://github.com/gracewang2322)] * Role: Developer -* Responsibilities: Data +* Responsibilities: Documentation, Deliverables and Deadlines -### Jean Doe +### Wang Pei - + -[[github](http://github.com/johndoe)] -[[portfolio](team/johndoe.md)] +[[github](http://github.com/wangpeialex)] * Role: Developer -* Responsibilities: Dev Ops + Threading +* Responsibilities: Testing, Storage -### James Doe +### Bernardus Krishna - + -[[github](http://github.com/johndoe)] -[[portfolio](team/johndoe.md)] +[[github](https://github.com/bernarduskrishna)] * Role: Developer -* Responsibilities: UI +* Responsibilities: Model, Logic diff --git a/docs/Configuration.md b/docs/Configuration.md index 13cf0faea16..cc669bdd0cc 100644 --- a/docs/Configuration.md +++ b/docs/Configuration.md @@ -1,6 +1,8 @@ --- layout: page title: Configuration guide +parent: For Developers +nav_order: 2 --- Certain properties of the application can be controlled (e.g user preferences file location, logging level) through the configuration file (default: `config.json`). diff --git a/docs/DevOps.md b/docs/DevOps.md index ca59d92f2cb..943f89d9c5c 100644 --- a/docs/DevOps.md +++ b/docs/DevOps.md @@ -1,25 +1,23 @@ --- -layout: page -title: DevOps guide +layout: page title: DevOps guide parent: For Developers --- -* Table of Contents -{:toc} +* Table of Contents {:toc} -------------------------------------------------------------------------------------------------------------------- ## Build automation -This project uses Gradle for **build automation and dependency management**. **You are recommended to read [this Gradle Tutorial from the se-edu/guides](https://se-education.org/guides/tutorials/gradle.html)**. - +This project uses Gradle for **build automation and dependency management**. **You are recommended to +read [this Gradle Tutorial from the se-edu/guides](https://se-education.org/guides/tutorials/gradle.html)**. Given below are how to use Gradle for some important project tasks. - * **`clean`**: Deletes the files created during the previous build tasks (e.g. files in the `build` folder).
e.g. `./gradlew clean` -* **`shadowJar`**: Uses the ShadowJar plugin to creat a fat JAR file in the `build/lib` folder, *if the current file is outdated*.
+* **`shadowJar`**: Uses the ShadowJar plugin to creat a fat JAR file in the `build/lib` folder, *if the current file is + outdated*.
e.g. `./gradlew shadowJar`. * **`run`**: Builds and runs the application.
@@ -29,28 +27,37 @@ Given below are how to use Gradle for some important project tasks. **`checkstyleTest`**: Runs the code style check for the test code base. * **`test`**: Runs all tests.< - * `./gradlew test` — Runs all tests - * `./gradlew clean test` — Cleans the project and runs tests + * `./gradlew test` — Runs all tests + * `./gradlew clean test` — Cleans the project and runs tests -------------------------------------------------------------------------------------------------------------------- ## Continuous integration (CI) -This project uses GitHub Actions for CI. The project comes with the necessary GitHub Actions configurations files (in the `.github/workflows` folder). No further setting up required. +This project uses GitHub Actions for CI. The project comes with the necessary GitHub Actions configurations files (in +the `.github/workflows` folder). No further setting up required. ### Code coverage -As part of CI, this project uses Codecov to generate coverage reports. Here are the steps to set up CodeCov for a fork of this repository. +As part of CI, this project uses Codecov to generate coverage reports. Here are the steps to set up CodeCov for a fork +of this repository. 1. Sign up with Codecov using your GitHub account [here](https://codecov.io/signup). 1. Once you are inside Codecov web app, add your fork to CodeCov. -1. Get the Markdown code for the Codecov badge provided in `Settings > Badges` and update the `docs/index.md` of your repo with it so that the badge [![codecov](https://codecov.io/gh/se-edu/addressbook-level3/branch/master/graph/badge.svg)](https://codecov.io/gh/se-edu/addressbook-level3) in that page reflects the coverage of your project. +1. Get the Markdown code for the Codecov badge provided in `Settings > Badges` and update the `docs/index.md` of your + repo with it so that the + badge [![codecov](https://codecov.io/gh/se-edu/addressbook-level3/branch/master/graph/badge.svg)](https://codecov.io/gh/se-edu/addressbook-level3) + in that page reflects the coverage of your project. ### Repository-wide checks -In addition to running Gradle checks, CI includes some repository-wide checks. Unlike the Gradle checks which only cover files used in the build process, these repository-wide checks cover all files in the repository. They check for repository rules which are hard to enforce on development machines such as line ending requirements. +In addition to running Gradle checks, CI includes some repository-wide checks. Unlike the Gradle checks which only cover +files used in the build process, these repository-wide checks cover all files in the repository. They check for +repository rules which are hard to enforce on development machines such as line ending requirements. -These checks are implemented as POSIX shell scripts, and thus can only be run on POSIX-compliant operating systems such as macOS and Linux. To run all checks locally on these operating systems, execute the following in the repository root directory: +These checks are implemented as POSIX shell scripts, and thus can only be run on POSIX-compliant operating systems such +as macOS and Linux. To run all checks locally on these operating systems, execute the following in the repository root +directory: `./config/travis/run-checks.sh` @@ -58,12 +65,14 @@ Any warnings or errors will be printed out to the console. **If adding new checks:** -* Checks are implemented as executable `check-*` scripts within the `.github` directory. The `run-checks.sh` script will automatically pick up and run files named as such. That is, you can add more such files if you need and the CI will do the rest. +* Checks are implemented as executable `check-*` scripts within the `.github` directory. The `run-checks.sh` script will + automatically pick up and run files named as such. That is, you can add more such files if you need and the CI will do + the rest. * Check scripts should print out errors in the format `SEVERITY:FILENAME:LINE: MESSAGE` - * SEVERITY is either ERROR or WARN. - * FILENAME is the path to the file relative to the current directory. - * LINE is the line of the file where the error occurred and MESSAGE is the message explaining the error. + * SEVERITY is either ERROR or WARN. + * FILENAME is the path to the file relative to the current directory. + * LINE is the line of the file where the error occurred and MESSAGE is the message explaining the error. * Check scripts must exit with a non-zero exit code if any errors occur. @@ -73,7 +82,10 @@ Any warnings or errors will be printed out to the console. Here are the steps to create a new release. -1. Update the version number in [`MainApp.java`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/java/seedu/address/MainApp.java). +1. Update the version number + in [`MainApp.java`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/java/seedu/address/MainApp.java) + . 1. Generate a fat JAR file using Gradle (i.e., `gradlew shadowJar`). 1. Tag the repo with the version number. e.g. `v0.1` -1. [Create a new release using GitHub](https://help.github.com/articles/creating-releases/). Upload the JAR file you created. +1. [Create a new release using GitHub](https://help.github.com/articles/creating-releases/). Upload the JAR file you + created. diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index 46eae8ee565..a599b49ee59 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -1,15 +1,26 @@ --- -layout: page -title: Developer Guide +layout: page +title: Developer Guide +parent: For Developers +nav_order: 1 --- -* Table of Contents + +
+ + Table of contents + + {: .text-delta } +1. TOC {:toc} +
-------------------------------------------------------------------------------------------------------------------- ## **Acknowledgements** -* {list here sources of all reused/adapted ideas, code, documentation, and third-party libraries -- include links to the original source as well} +* BogoBogo is forked from [Addressbook Level 3](https://se-education.org/addressbook-level3/) +* Libraries used: [JavaFX](https://openjfx.io/), [Jackson](https://github.com/FasterXML/jackson), [JUnit5](https://github.com/junit-team/junit5) +* Theme used: [just-the-docs](https://github.com/pmarsceill/just-the-docs) -------------------------------------------------------------------------------------------------------------------- @@ -21,14 +32,17 @@ Refer to the guide [_Setting up and getting started_](SettingUp.md). ## **Design** -
+
-: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: The `.puml` files used to create diagrams in this document can be found in +the [diagrams](https://github.com/AY2122S1-CS2103-F10-2/tp/blob/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 - +![Architecture Diagram](images/ArchitectureDiagram.png) The ***Architecture Diagram*** given above explains the high-level design of the App. @@ -36,7 +50,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/AY2122S1-CS2103-F10-2/tp/blob/master/src/main/java/seedu/address/Main.java) +and [`MainApp`](https://github.com/AY2122S1-CS2103-F10-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,100 +67,135 @@ 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 Milk c/5`. - +![Delete Sequence Diagram](images/ArchitectureSequenceDiagram.png) 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. - +![Component Managers](images/ComponentManagers.png) 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/AY2122S1-CS2103-F10-2/tp/blob/master/src/main/java/seedu/address/ui/Ui.java) ![Structure of the UI Component](images/UiClassDiagram.png) -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 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` 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/AY2122S1-CS2103-F10-2/tp/blob/master/src/main/java/seedu/address/ui/MainWindow.java) +is specified +in [`MainWindow.fxml`](https://github.com/AY2122S1-CS2103-F10-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 `Displayable` 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) +The **API** of this component is specified +in [`Logic.java`](https://github.com/AY2122S1-CS2103-F10-2/tp/blob/master/src/main/java/seedu/address/logic/Logic.java) Here's a (partial) class diagram of the `Logic` component: - +![Logic class diagram](images/LogicClassDiagram.png) 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`. +2. This results in a `Command` object (more precisely, an object of one of its subclasses e.g. `AddCommand`) which is + executed by the `LogicManager`. +3. The command can communicate with the `Model` when it is executed (e.g. to add an item). +4. The result of the command execution is encapsulated as a `CommandResult` object which is returned by `Logic` back to the caller. -The Sequence Diagram below illustrates the interactions within the `Logic` component for the `execute("delete 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 1` Command](images/DeleteSequenceDiagram.png) +![Interactions Inside the Logic Component for the `delete Milk c/5` Command](images/DeleteSequenceDiagram.png) -
: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. +
+:information_source: 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: - +![Parser_Classes](images/ParserClasses.png) 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. + +* 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. ### Model component -**API** : [`Model.java`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/java/seedu/address/model/Model.java) - +The **API** of this component is specified +in [`Model.java`](https://github.com/AY2122S1-CS2103-F10-2/tp/blob/master/src/main/java/seedu/address/model/Model.java) +![Model class diagram](images/ModelClassDiagram.png) -The `Model` component, +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 an `Inventory` object that encapsulates the inventory data. +- stores an optional `Order` object that encapsulates the data of current order. +- stores a `TransactionList` object that encapsulates the history of past transactions. +- stores a `UserPref` object that encapsulates the user’s preferences. +- 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.
- +![Model Low Level class diagram](images/ModelLowLevelClassDiagram.png) -
+Lower level details of `Model` component: +- `Inventory` and `Order` each has a `UniqueItemList` which contains a collection of `Item`. +- A `TransactionRecord` represents a past order that has been transacted, with timestamp of occurrence. +- The `TransactionList` stores the history of all `TransactionRecord`. ### Storage component -**API** : [`Storage.java`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/java/seedu/address/storage/Storage.java) +The **API** of this component is specified +in [`Storage.java`](https://github.com/AY2122S1-CS2103-F10-2/tp/blob/master/src/main/java/seedu/address/storage/Storage.java). + +![Storage class diagram](images/StorageClassDiagram.png) + +The `Storage` component's responsibility is to read and write persistent data. +It can save inventory data, user preference data, bookkeeping data, and transaction history in json format, +and read them back into corresponding objects. - +The storage of different aspects of BogoBogo's data are each managed by their own class: -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`) +* Inventory Data: `JsonInventoryStorage` +* User Preferences: `JsonUserPrefStorage` +* BookKeeping Data: `JsonBookKeepingStorage` +* Transaction History: `JsonTransactionStorage` + +Each of these classes employ a facade interface that `Storage` inherits from. +This ensures that `Storage` will have the necessary API for `Logic` to call when it wishes to save BogoBogo's state. ### Common classes @@ -154,90 +207,188 @@ Classes used by multiple components are in the `seedu.addressbook.commons` packa This section describes some noteworthy details on how certain features are implemented. -### \[Proposed\] Undo/redo feature +### Ordering -#### Proposed Implementation +Placing an order occurs across multiple user commands (`sorder`, `iorder`, `eorder`). +Here is an example of how each command changes the state of `Model`. -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: +When ModelManager is initialised, `optionalOrder` is set to an empty `Optional`. At this point, the user has 1 order record +with 2 items in his transaction list. -* `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. +![Initial_State](images/OrderInitialState.png) -These operations are exposed in the `Model` interface as `Model#commitAddressBook()`, `Model#undoAddressBook()` and `Model#redoAddressBook()` respectively. +Step 1. The user enters ordering mode via the `sorder` command. -Given below is an example usage scenario and how the undo/redo mechanism behaves at each step. +Upon entering the ordering mode, optionalOrder now has a new Order() which is empty. -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. +![Sorder_State](images/OrderSorderState.png) -![UndoRedoState0](images/UndoRedoState0.png) +Step 2. The user adds an item to the order via the `iorder` command. -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. +Upon entering `iorder Banana c/1`, the order now contains 1 banana item. -![UndoRedoState1](images/UndoRedoState1.png) +![Iorder_State](images/OrderItem1State.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`. +Next, upon entering `iorder Strawberry c/1`, the order now contains 1 strawberry item. -![UndoRedoState2](images/UndoRedoState2.png) +![Iorder_State](images/OrderItem2State.png) -
:information_source: **Note:** If a command fails its execution, it will not call `Model#commitAddressBook()`, so the address book state will not be saved into the `addressBookStateList`. +Step 3. The user transacts and ends the order via the `eorder` command. -
+After the transaction is done, optionalOrder is reinitialised to Optional.empty(). -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. +![Initial_State](images/OrderFinalState.png) -![UndoRedoState3](images/UndoRedoState3.png) +Step 4. The new transactions are saved to the json file. -
:information_source: **Note:** If the `currentStatePointer` is at index 0, pointing to the initial AddressBook state, then there are no previous AddressBook states to restore. The `undo` command uses `Model#canUndoAddressBook()` to check if this is the case. If so, it will return an error to the user rather -than attempting to perform the undo. +![Transact_Order_Sequence_Diagram](images/TransactOrderSequenceDiagram.png) -
+### Mutating Inventory + +This section explains how various commands update the list of items in the inventory and display the result. + +As described in the UML diagram of the Model component above, `Inventory` contains a `UniqueItemList` object which in turn +has `Item` objects. Every time add, remove, edit, delete, or clear is called, the `UniqueItemList` inside Inventory is +mutated, after which the UI will be changed upon the call of a method that mutates the `DisplayList` field inside +`ModelManager` such as `UpdateFilteredItemList()`. More specifically, the `ObservableList` inside the +`DisplayList` class is mutated. + +The following sequence diagram shows what happens upon an addition of item to inventory until the +`ObservableList` inside DisplayList changes. + +![AddSequenceDiagram](images/AddSequenceDiagram.png) + +Another design decision that we have done is that `Item` objects are strictly immutable, as seen by all the +final fields. Thus, when any field is mutated, the previous `Item` is destroyed and a new `Item` is created. The +following activity diagram shows some possible actions that a user might take. Take note also on the difference +between Remove and Delete command. -The following sequence diagram shows how the undo operation works: +![MutatingInventoryActivityDiagram](images/MutatingInventoryActivityDiagram.png) -![UndoSequenceDiagram](images/UndoSequenceDiagram.png) +### Controlling the Display Panel in UI -
:information_source: **Note:** The lifeline for `UndoCommand` should end at the destroy marker (X) but due to a limitation of PlantUML, the lifeline reaches the end of diagram. +The main panel of displayed items in the UI is managed by `DisplayListPanel` in the UI component. +This panel is dependent on changes made by command logic and should be able to be toggled to display different lists +(e.g. inventory items, items in current order, list of transactions, etc.). +To minimise coupling between the logic and UI component, `DisplayListPanel` adopts an **observer pattern**. + +![DisplayList1](images/ObserverPattern.png) + +`DisplayListPanel` observes an `ObservableList` which is controlled by a `DisplayList` in the model component. +This way, any changes to model can be propagated to the Ui without having to explicitly have knowledge about the Ui component. + +`DisplayList` is composed of 3 lists. +1. `DisplayList#filtered` —  A filtered list that is observed by `DisplayListPanel`. +2. `DisplayList#displayed` —  An observable list that acts as the base for `DisplayList#filtered`. +Observes the current `DisplayList#source`. +3. `DisplayList#source` —  An observable list that acts as the base for `DisplayList#displayed`. + +To propagate any changes to the filtered list, to be reflected to the ui, we can: + +1 . **Filter the displayed list**. `DisplayList#setPredicate()` + +Set a predicate on the filtered list. This is done when items to be displayed already exists in `DisplayList#source`. + +2 . **Mutate the displayed list**. + +When the source is edited outside `DisplayList`, it will notify `DisplayList#displayed`, which will then copy and reflect all changes. +This resultantly updates the `DisplayList#filtered` and the display panel. + +3 . **Update the source**. `DisplayList#setItems()` + +`DisplayList` removes the listener from the previous source and adds a new listener to the new source. +`DisplayList#displayed` is updated to reflect the new source. +This is done when we want to switch between lists to display. (e.g. displaying transactions instead of inventory) + +
:information_source: +DisplayList uses a 3 list approach because of the way JavaFX has implemented `FilteredList`. +`FilteredList` is bound to a `ObservableList` which is bound to a regular `List`.
-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. +*Displaying an object*{: .text-purple-000 } + +Any object can be displayed in the display panel by implementing the `Displayable` interface. +The object must implement `Displayable#asDisplayCard()` which should return a `UIPart` that will act as the object's list cell. + +![DisplayList3](images/ModelDisplayableClassDiagram.png) + +*Design Considerations*{: .text-purple-000 } + +**Time complexity** + +Each update to source requires DisplayList to copy over an entire list (complexity: _O(n)_). +This is definitely inefficient since updates usually involve appending or removing an item from source. +(e.g. when the user adds an item to the inventory). -
: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. +This inefficiency does not create observable latency given the envisioned scale of BogoBogo (1000 items). +However, if BogoBogo is to be scaled up in the future, there might be a need for a more advanced implementation. +
:bulb: Proposed Upgrade: +Instead of relying on JavaFX's `ObservableList`, we can create a customised observable list that can reference multiple sources. +From there, we should be able to toggle which source we want to be displaying on the `filteredlist`. This way, copying is no longer required.
-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. +### [Proposed Feature] Autocompleting commands -![UndoRedoState4](images/UndoRedoState4.png) +BogoBogo is optimised for users that prefer the speed of CLI-based applications. +The application will be more attractive to typists if there is an **autocompleting feature**. +With the feature, the user doesn't need to type entire command keywords or product names. -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. +``` +System: BogoBogo +Sugggested Use Case —  Autocompleting a command +Actor: User +MSS: + 1. User types half a command. + 2. User requests for BogoBogo to autocomplete the command. + 3. BogoBogo suggests to the user a complete command. + Step 2 - 3 is repeated until User finds the intended command. + 4. User submits the autocompleted command. + 5. BogoBogo processes the command. -![UndoRedoState5](images/UndoRedoState5.png) +Extensions: + 2a. BogoBogo cannot guess the user's command. + 2a1. BogoBogo notifies the user it cannot autocomplete the command. + 2a2. User enters the entire command. + Use case resumes from step 5. +``` -The following activity diagram summarizes what happens when a user executes a new command: +The user can request for an autocomplete by hitting the `tab` character. - +*Lower level details*{: .text-purple-000 } -#### Design considerations: +Autocompletion can be facilitated by a `Wordbank` class which contains: +* A trie for command keywords +* A trie for existing item names. -**Aspect: How undo & redo executes:** +A `CompleteCommand` can then query `Wordbank` to complete either a command keyword or item name. +`Wordbank` also has to be updated when the user adds or removes a unique item name. -* **Alternative 1 (current choice):** Saves the entire address book. - * Pros: Easy to implement. - * Cons: May have performance issues in terms of memory usage. +![WordbankUML](images/WordbankUML.png) -* **Alternative 2:** Individual command knows how to undo/redo by - itself. - * Pros: Will use less memory (e.g. for `delete`, just save the person being deleted). - * Cons: We must ensure that the implementation of each individual command are correct. +*Higher level details*{: .text-purple-000 } -_{more aspects and alternatives to be added}_ +BogoBogo will have 2 different ways to react to a command. -### \[Proposed\] Data archiving +![AutocompleteActivityDiagram](images/AutocompleteActivityDiagram.png) -_{Explain here how the data archiving feature will be implemented}_ +1. The user hits the `enter` key: the command is processed normally. +2. The user hits the `tab` key: the command is autocompleted. +For the ui to distinguish the 2, we will need to implement a `CommandSuggestion` class that extends `CommandResult`. +Should `CommandBox` detect a `CommandSuggestion` class when executing a command, it will adopt the suggestion stored in the result. + +Here's an example of how BogoBogo can react to the command text "add noo" followed by the user hitting the `tab` character. +![AutocompleteSequenceDiagram](images/AutocompleteSequenceDiagram.png) + +*Design considerations*{: .text-purple-000 } + +BogoBogo adopts an [MVC pattern](https://nus-cs2103-ay2021s1.github.io/website/se-book-adapted/chapters/designPatterns.html#model-view-controller-mvc-pattern). +By utilising a `CommandSuggestion` class to store the autocompleted command, the partition between view and controller is retained. + +Alternatively, `CommandBox` can give `Logic` a callback to edit its text field. +However, implementing auxiliary methods to support the callback pattern will likely require more effort. -------------------------------------------------------------------------------------------------------------------- @@ -257,71 +408,442 @@ _{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 +* small business owner / entrepreneur +* prefers desktop apps over other types * can type fast * prefers typing to mouse interactions * is reasonably comfortable using CLI apps -**Value proposition**: manage contacts faster than a typical mouse/GUI driven app - +**Value proposition**: manage a small business' inventory and finances faster than a typical mouse/GUI driven app ### 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…​ | +| -------- | ------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------- | +| `* * *` | small business owner | add items into the inventory list | account for newly stocked items | +| `* * *` | small business owner | record item related information (name, price, cost, id) | record and track items' details easily | +| `* * *` | careless business owner | delete items from the inventory | remove wrongly added items and not incur any cost | +| `* * *` | small business owner | remove items from the inventory | account for discarded or sold items | +| `* * *` | small business owner | look at all my inventory items, and their information | review and track my inventory | +| `* * *` | small business owner | record new orders and update the inventory accordingly | account for newly confirmed orders | +| `* * *` | small business owner | search for item details quickly | respond to client or my own queries promptly | +| `* *` | small business owner | list past transactions | review and verify transaction details | +| `* *` | budget-savvy business owner | track the cost and profit that each item incurs | manage business costs and revenue closely | +| `* *` | organised business owner | sort my inventory by name | keep my inventory easy to navigate | +| `* *` | small business owner | identify items that are running low in inventory | track which items need to be restocked | +| `* *` | first time user | seek help on how to utilise the application | | +| `*` | prudent business owner | identify my bestsellers and flops | reprice my items and optimise profits | +| `*` | risk-averse business owner | password protect my application | my data is kept private | ### Use cases -(For all use cases below, the **System** is the `AddressBook` and the **Actor** is the `user`, unless specified otherwise) - -**Use case: Delete a person** +For all use cases below, the **System** is the `Bogo Bogo` and the **Actor** is the `user`, unless specified otherwise. + +*Mutating the Inventory*{: .text-purple-000 } + +
+ + UC01 - Adding Item(s) + + {: .text-delta } + +``` +MSS: +1. User requests to add a certain amount of an item into the inventory. +2. BogoBogo saves the item(s) into the inventory. + Use case ends. + +Extensions: +1a. User is adding the item for the first time, + and did not specify the id, cost price or sell price of the item. + 1a1. BogoBogo informs user of the missing details. + 1a2. User reenters the missing details. + Use case resumes at step 2. + +1b. User did not specify the count. + 1b1. BogoBogo assumes count to be 1. + Use case resumes at step 2. + +1c. The given id and name corresponds to 2 separate items in the inventory. + 1c1. BogoBogo notifies user of the ambiguity and shows the list of possible matches. + 1c2. User reenters the corrected details. + +1d. The given name matches an item, but the given id is non-existent, + or the given id matches the item but the given name is non existent. + 1d1. BogoBogo notifies user of the mismatch. + 1d2. User reenters the corrected details. + Use case resumes at step 2. +``` + +
+ +
+ + UC02 - Deleting an Item + + {: .text-delta } + +``` +MSS: +1. User requests to delete an item from the inventory. +2. BogoBogo deletes the item from the inventory. + Use case ends. + +Extensions: +1a. User specified neither the name nor id of the item. + 1a1. BogoBogo notifies user of missing details. + Use case ends. -**MSS** +1b. The specified item is not in the inventory. + 1b1. BogoBogo notifies user that the item is not found. + Use case ends. -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 +1c. The given id and name corresponds to 2 separate items in the inventory. + 1c1. BogoBogo notifies user of the ambiguity and shows the list of possible matches. + 1c2. User reenters the corrected details. + Use case resumes at step 2. + +1d. The given name matches an item, but the given id is non-existent, + or the given id matches the item but the given name is non existent. + 1d1. BogoBogo notifies user of the mismatch. + 1d2. User reenters the corrected details. + Use case resumes at step 2. +``` + +
+ +
+ + UC03 - Removing Item(s) + + {: .text-delta } + +``` +MSS: +1. User requests to remove a certain amount of an item from the inventory. +2. BogoBogo removes the specified amount of that item. + Use case ends. + +Extensions: +1a. User specified neither the name nor id of the item. + 1a1. BogoBogo notifies user of missing details. + Use case ends. + +1b. The specified item is not in the inventory. + 1b1. BogoBogo notifies user that the item is not found. + Use case ends. +1c. The given id and name corresponds to 2 separate items in the inventory. + 1c1. BogoBogo notifies user of the ambiguity and shows the list of possible matches. + 1c2. User reenters the corrected details. + Use case resumes at step 2. + +1d. The given name matches an item, but the given id is non-existent, + or the given id matches the item but the given name is non existent. + 1d1. BogoBogo notifies user of the mismatch. + 1d2. User reenters the corrected details. + Use case resumes at step 2. + +1e. User did not specify the count. + 1e1. BogoBogo assumes count to be 1. + Use case resumes at step 2. + +1f. The specified amount is greater than what the inventory has. + 1f1. BogoBogo notifies user of the actual amount of item in the inventory. + Use case ends. +``` + +
+ +
+ + UC04 - Editing an Item + + {: .text-delta } + +``` +Precondition: BogoBogo is displaying the inventory. +MSS: +1. User requests to edit an item, specifying an item by index, + with the fields and values to change. +2. BogoBogo updates the fields of the item at the specified index with the new values given. + Use case ends. + +Extensions: +1a. The specified index does not point to any item. + 1a1. BogoBogo notifies the user that the index is invalid. Use case ends. -**Extensions** +1b. User specified a new ID/name that already belongs to a different item. + 1b1. BogoBogo notifies the user of clashing IDs/names. + Use case ends. -* 2a. The list is empty. +1c. User attempted to edit the count of an item + 1c1. BogoBogo notifies the user that directly editing count is not supported. + Use case ends. +``` + +
+ +
+ + UC05 - Clearing the Inventory + + {: .text-delta } + +``` +MSS: +1. User requests to clear the inventory. +2. BogoBogo acknowledges the request and clears the inventory. + Use case ends. +``` +
+ +*Navigating the Inventory*{: .text-purple-000 .text-gamma } + +
+ + UC06 - Finding an Item + + {: .text-delta } + +``` +MSS: +1. User searches for an item in the inventory + by specifying possible id(s), name(s) or tag(s). +2. BogoBogo finds all items in the inventory that matches any of the descriptors. + Use case ends. +``` +
+ +
+ + UC07 - Sorting the Inventory + + {: .text-delta } + +``` +Precondition: BogoBogo is displaying the inventory. +MSS: +1. User requests to sort the inventory (either by name or count). +2. BogoBogo sorts the inventory accordingly. + Use case ends. + +Extensions: +1a. User specifies to sort by both name and count. + 1a1. BogoBogo notifies user that user can only sort by either name or count, not both. + Use case ends. +``` +
+ +
+ + UC08 - Listing the Inventory + + {: .text-delta } + +``` +MSS: +1. User requests to list out all items in the inventory +2. BogoBogo lists out all items in inventory. + Use case ends. +``` +
+ +*Managing Orders*{: .text-purple-000 } + +
+ + UC09 - Placing an Order + + {: .text-delta } + +``` +MSS: +1. User requests to start an order. +2. BogoBogo creates an order and requests for item names and quantities. +3. User adds an item into the order. +4. BogoBogo saves the item into the order. + Step 3-4 is repeated until the user wishes to end the order. +5. User requests to end entering item and place the order. +6. BogoBogo transacts the order and updates inventory and transaction history. + Use case ends. + + +Extensions: +1a. User is already in ordering mode + 1a1. BogoBogo informs the user that the current mode is already ordering mode. + Use case resumes at step 3. + +3a. User adds an item that is not in the inventory. + 3a1. BogoBogo notifies user that item is not found. + Use case resumes at step 3. + +3b. There is an insufficient supply of added items in the inventory. + 3b1. BogoBogo notifies user of the supply shortage. + Use case resumes at step 3. + +3c. User did not specify count. + 3c1. BogoBogo assumes count to be 1. + Use case resumes at step 4. + +3d. The given id and name corresponds to 2 separate items in the inventory. + 3d1. BogoBogo notifies user of the ambiguity and shows the list of possible matches. + 3d2. User reenters the corrected details. + Use case resumes at step 4. + +3e. The given name matches an item, but the given id is non-existent, + or the given id matches the item but the given name is non existent. + 3e1. BogoBogo notifies user of the mismatch. + 3e2. User reenters the corrected details. + Use case resumes at step 4. + +4a. User incorrectly added an item into the order. + 4a1. User removes specified item from the order (UC10). + Use case resumes at step 3. + +5a. The order is empty. + 5a1. BogoBogo notifies user that the order is empty and closes the order. + Use case ends. +``` + +
+ +
+ + UC10 - Removing an item from Order + + {: .text-delta } + +``` +Precondition: The user has started an order. +MSS: +1. User requests to remove the specified item from the order. +2. BogoBogo removes the item from the order. + Use case ends. + +Extensions: +1a. The specified item is not in the order + 1a1 BogoBogo notifies user the specified item is not in the order. + Use case ends. + +1b. User did not specify count. + 1b1. BogoBogo assumes count to be 1. + Use case resumes at step 2. + +1c. The given id and name corresponds to 2 separate items in the inventory. + 1c1. BogoBogo notifies user of the ambiguity. + 1c2. User reenters the corrected details. + Use case resumes at step 2. + +1d. The given name matches an item, but the given id is non-existent, + or the given id matches the item but the given name is non existent. + 1d1. BogoBogo notifies user of the mismatch. + 1d2. User reenters the corrected details. + Use case resumes at step 2. +``` + +
+ +
+ + UC11 - Listing the current Order + + {: .text-delta } + +``` +MSS: +1. User requests to list out current order. +2. BogoBogo lists out all items in current order. + Use case ends. + +Extensions: +1a. There is currently no open order. + 1a1. BogoBogo notifies user there is currently no open order. + Use case ends. +``` + +
+ +
+ + UC12 - Viewing Past Transactions + + {: .text-delta } + +``` +MSS: +1. User requests to view list of past transactions. +2. BogoBogo lists past transactions, each with an id. +3. User requests to view a specific transaction's contents. +4. BogoBogo opens up the specified transaction and displays its items. + Use case ends. + +Extensions: +3a. The transaction specified does not exist. + 3a1. BogoBogo notifies the user the transaction does not exist. + Use case ends. +``` +
+ +*Others*{: .text-purple-000 .text-gamma } + +
+ + UC13 - Seeking Help + + {: .text-delta } + +``` +MSS: +1. User requests for guidance in using BogoBogo. +2. BogoBogo shares a link to the user guide. + Use case ends. + +Extensions: +1a. User requests guidance for a specific command. + 1a1. BogoBogo shares with the user a brief how-to guide. + Use case ends. - Use case ends. +1b. User requests guidance for an inexistent command. + 1b1. BogoBogo notifies the user that the command does not exist. + Use case resumes at step 2. +``` -* 3a. The given index is invalid. +
- * 3a1. AddressBook shows an error message. +
+ + UC14 - Exiting the Application + + {: .text-delta } - Use case resumes at step 2. +``` +MSS: +1. User requests to exit the application -*{More to be added}* +2. BogoBogo exits. + Use case ends. +``` +
### 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. - -*{More to be added}* +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 distinct inventory items 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. ### Glossary * **Mainstream OS**: Windows, Linux, Unix, OS-X -* **Private contact detail**: A contact detail that is not meant to be shared with others +* **Item**: An inventory good that the user is/was selling +* **Order**: Information regarding the items a customer is buying from the user. +* **Open/current order**: An unconfirmed order that the user is in the midst of entering into BogoBogo. +* **Transaction**: A confirmed order whereby the transaction of money for items has occurred. -------------------------------------------------------------------------------------------------------------------- @@ -329,49 +851,236 @@ 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; -testers are expected to do more *exploratory* testing. +
:information_source: These instructions only provide a starting point for testers to work on; +testers should do more exploratory testing.
-### Launch and shutdown +*Launch and shutdown*{: .text-beta : .text-purple-000 } 1. Initial launch - 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. - -1. Saving window preferences - - 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.
- Expected: The most recent window size and location is retained. - -1. _{ more test cases …​ }_ - -### Deleting a person - -1. Deleting a person while all persons are being shown - - 1. Prerequisites: List all persons using the `list` command. Multiple persons in the list. - - 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. - - 1. Test case: `delete 0`
- Expected: No person is deleted. Error details shown in the status message. Status bar remains the same. - - 1. Other incorrect delete commands to try: `delete`, `delete x`, `...` (where x is larger than the list size)
- Expected: Similar to previous. - -1. _{ more test cases …​ }_ + a. Download the jar file and copy into an empty folder + + b. Double-click the jar file Expected: Shows the GUI with a set of sample contacts. The window size may not be + optimum. + +2. Saving window preferences + + a. Resize the window to an optimum size. Move the window to a different location. Close the window. + + b. Re-launch the app by double-clicking the jar file.
+ Expected: The most recent window size and location is retained. + + +*Mutating the Inventory*{: .text-beta : .text-purple-000 } + +### Adding Item + 1. Test case: `add milk id/232433 c/4 cp/3.0 sp/3.0` + Expected: Milk item is successfully added into the inventory. + 2. Test case: `add milk id/232433 c/4 sp/3.0` + Expected: Bogobogo displays error saying that name, id, costprice and salesprice + must all be provided. + 3. Test case: `add milk` + Expected: Milk item is replenished by count 1 in the inventory. + 4. Test case: `add id/247937` + Expected: Item with the specified id is replenished by count 1 in the inventory. + +### Deleting Item + 1. Test case: `delete milk id/232433` + Expected: Milk item is successfully deleted from the inventory. + 2. Test case: `delete milk` + Expected: Milk item is successfully deleted from the inventory. + 3. Test case: `delete id/232433` + Expected: Milk item is successfully deleted from the inventory. + 4. Test case: `delete milk cp/3.0` + Expected: Milk is not deleted. Bogobogo outputs error that DeleteCommand + does not require costprice, salesprice and tag fields. + +### Removing Item + 1. Test case: `remove milk id/232433` + Expected: Milk item is successfully removed from the inventory. + 2. Test case: `remove milk` + Expected: Milk item is successfully removed from the inventory. + 3. Test case: `remove id/232433` + Expected: Milk item is successfully removed from the inventory. + 4. Test case: `remove id/232433 c/5` + Expected: x5 Milk item is successfully removed from the inventory. + 5. Test case: `remove milk cp/3.0` + Expected: Milk is removed. Bogobogo outputs message that extra price fields are ignored. + +### Editing Item + 1. Test case: `edit 0 n/milk` + Expected: Bogobogo outputs error as index is 1 based. + 2. Test case: `edit 1 n/milk` + Expected: Name of the first item in the inventory is edited to milk. + 3. Test case: `edit 1 id/329749` + Expected: Id of the first item in the inventory is edited to 329749. + 4. Test case: `edit 1 cp/3.0 sp/3.0` + Expected: Costprice and Salesprice of the first item in the inventory is edited to $3.0. + 5. Test case: `edit 1 c/5` + Expected: First item is not edited. Bogobogo outputs error that count + cannot be edited directly. + +### Clearing the Inventory + 1. Test case: `clear` + Expected: Bogobogo clears the entire inventory. + 2. Test case: `clear milkandcookie` + Expected: Extra words are ignored. Bogobogo clears the entire inventory. + +### Finding Item + 1. Test case: `find n/milk` + Expected: Bogobogo outputs the list of items that matches the field specified. + 2. Test case: `find n/milk n/cookie` + Expected: Bogobogo outputs the list of items that matches the field specified. + 3. Test case: `find id/329749` + Expected: Bogobogo outputs the list of items that matches the field specified. + 4. Test case: `find t/popular` + Expected: Bogobogo outputs the list of items that matches the field specified. + 5. Test case: `find cp/3.0` + Expected: Bogobogo outputs error that there is unexpected prefix identified. + 6. Test case: `find cookie` + Expected: Bogobogo outputs error that the command format is invalid. + +### Sorting the Inventory + 1. Test case: `sort` + Expected: Bogobogo outputs error that the command format is invalid. + 2. Test case: `sort n/` + Expected: Bogobogo outputs the list of items sorted by name in alphabetical order. + 3. Test case: `sort n/milk` + Expected: Bogobogo outputs error that the command format is invalid. + 4. Test case: `sort hello` + Expected: Bogobogo outputs error that the command format is invalid. + +### Listing an Inventory + 1. Test case: `list` + Expected: Bogobogo outputs the list of items in the inventory. + 2. Test case: `list oo` + Expected: Bogobogo outputs error that the command format is invalid. + 3. Test case: `list n/milk` + Expected: Bogobogo outputs error that the command format is invalid. + +*Managing Order*{: .text-beta : .text-purple-000 } + +### Starting Order + 1. Test case: `sorder` + Expected: Bogobogo starts a new order and enters ordering mode. + 2. Test case: `sorder milkandcookie` + Expected: Extra words are ignored. Bogobogo starts a new order and enters ordering mode. + +### Adding Item into Order + 1. Test case: `iorder milk` + Expected: Bogobogo inputs milk into the order. + 2. Test case: `iroder id/276434` + Expected: Bogobogo inputs item with id 276434 into the order. + 3. Test case: `iorder milk cp/3.0` + Expected: Bogobogo inputs milk into the order. Bogobogo outputs message that + extra price flags are ignored. + 4. Test case: `iorder milk t/baked` + Expected: Bogobogo inputs milk into the order. Bogobogo outputs message that + extra tag flags are ignored. + 5. Test case: `iorder g/` + Expected: Bogobogo outputs error that there is unexpected prefix identified. + +### Removing Item from Order + 1. Test case: `corder milk` + Expected: Bogobogo inputs milk into the order. + 2. Test case: `croder id/276434` + Expected: Bogobogo inputs item with id 276434 into the order. + 3. Test case: `corder g/` + Expected: Bogobogo outputs error that there is unexpected prefix identified. + +### Ending Order + 1. Test case: `eorder` + Expected: Bogobogo processes the current order and saves it. + 2. Test case: `eorder oo` + Expected: Bogobogo ignores the extra paramaters and process the current order to save it. + +### Listing the Current Order + 1. Test case: `list order` + Expected: Bogobogo outputs the list of items in the current order. + 2. Test case: `list oo` + Expected: Bogobogo outputs error that the command format is invalid. + +### Viewing Past Transactions + 1. Test case: `list txns` + Expected: Bogobogo outputs the list of past transactions together with + total cost, profit and revenue. + 2. Test case: `list txns bchfirwvb` + Expected: Bogobogo outputs the list of past transaction with id bchfirwvb together with + total cost, profit and revenue. + +*Others*{: .text-beta : : .text-purple-000 } + +### Seeking Help + 1. Test case: `help` + Expected: Bogobogo userguide is displayed in the feedback box. + 2. Test case: `help add` + Expected: Message usage of AddCommand is displayed in the feedback box. + +### Exiting the Application + 1. Test case: `exit` + Expected: Bogobogo exits the application. + 2. Test case: `exit oo` + Expected: Bogogbogo ignores the extra parameters and exits the application. + + +## **Appendix: Effort** +### Overall implementation effort + We rate the overall effort as 15 (150% as compared to AB3). + +### Challenges + 1. How to morph from `Person` of AB3 to `Item` of BogoBogo. + The `Item` object has `count` attribute which means duplicate is possible and needed + to be handled differently. + + Effort on this: Handle it from the perspective of aggregation and re-design and + implement the interactions between `Item` and other classes. + + 2. How to implement order system so that it is de-coupled with other classes and interact + smoothly with them. + + Effort on this: Enumerate possible design choices that could work and acheive the goal. + Discuss the pros and cons of the choices and implement the design. + + 3. How to change Ui component and display our new class objects to Ui. + + Effort on this: Trace and research on the Ui component to understand its structure. + Propose possible solutions to alter Ui and add new customized components. + Design the new Ui cards of Transactions. + Design and implement Observer pattern on these classes to ensure Ui interaction with + other components. + + 4. How to store the `Inventory`, `Order`, `Transaction` and `BookKeeping` data to + persistent data (i.e. to data file). + + The storage of `Inventory` is similar to how AB3 stores `PersonList` but the other + classes have different internal structure and attributes. + + Effort on this: Trace and reseach on the Storage component to understand its structure. + Design storage scheme of `Order`, `Transaction` and `BookKeeping` and implement them + to be compatible to JSON. + + 5. How to maintain abstractions between major compoents while newly added classes interacts + across multiple components. + + Effort on this: Implement facet interfaces between major components to de-couple classes. + +### Achievements + + 1. The inventory management and order system works smoothly together which enables user + not only item logging funtionalities, but also order and transaction tracking and bookkeepings. + + 2. The Ui is prettier and new class's Ui merge perfectly with the ones previous developed. + + 3. The code base is extensible and implementation notes are available in code comments as + well as developer guide. + + 4. The app can save and load more extensive and complex data files than AB3. -### Saving data + 5. There are much more funtional commands that users can use to acheive their purpose with BogoBogo. -1. Dealing with missing/corrupted data files + 6. Users can use the commands to navigate and switch between multiple Ui panels. - 1. _{explain how to simulate a missing/corrupted file, and the expected behavior}_ + 7. The commands are fully optimized and are more user friendly. -1. _{ more test cases …​ }_ diff --git a/docs/Documentation.md b/docs/Documentation.md index 3e68ea364e7..0543a67d31f 100644 --- a/docs/Documentation.md +++ b/docs/Documentation.md @@ -1,6 +1,8 @@ --- layout: page title: Documentation guide +parent: For Developers +nav_order: 5 --- **Setting up and maintaining the project website:** diff --git a/docs/ForDevelopers.md b/docs/ForDevelopers.md new file mode 100644 index 00000000000..31410705b7c --- /dev/null +++ b/docs/ForDevelopers.md @@ -0,0 +1,12 @@ +--- +layout: default +title: For Developers +nav_order: 3 +has_children: true +--- + +# For Developers +{: .no_toc } + +Contribute to BogoBogo! +Take a look at our Developer's Guide for an insight into our source code. Or you can look at our other guides to learn about our project conventions. diff --git a/docs/ForUsers.md b/docs/ForUsers.md new file mode 100644 index 00000000000..cb9c34f05a1 --- /dev/null +++ b/docs/ForUsers.md @@ -0,0 +1,13 @@ +--- +layout: default +title: For Users +nav_order: 2 +has_children: true +--- + +# For Users + +{: .no_toc } + +Use BogoBogo! +Read out [User's Guide](UserGuide.html#quick-start) to learn the different features of our program. diff --git a/docs/Gemfile b/docs/Gemfile index 999a7099d8d..364c63d3c1e 100644 --- a/docs/Gemfile +++ b/docs/Gemfile @@ -6,4 +6,5 @@ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" } gem 'jekyll' gem 'github-pages', group: :jekyll_plugins +gem 'just-the-docs' gem 'wdm', '~> 0.1.0' if Gem.win_platform? diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock index 397c4d044f8..3b19a6f9bfd 100644 --- a/docs/Gemfile.lock +++ b/docs/Gemfile.lock @@ -193,6 +193,10 @@ GEM gemoji (~> 3.0) html-pipeline (~> 2.2) jekyll (>= 3.0, < 5.0) + just-the-docs (0.3.3) + jekyll (>= 3.8.5) + jekyll-seo-tag (~> 2.0) + rake (>= 12.3.1, < 13.1.0) kramdown (1.17.0) liquid (4.0.3) listen (3.2.1) @@ -218,6 +222,7 @@ GEM forwardable-extended (~> 2.6) public_suffix (3.1.1) racc (1.5.2) + rake (13.0.1) rb-fsevent (0.10.4) rb-inotify (0.10.1) ffi (~> 1.0) @@ -251,6 +256,7 @@ PLATFORMS DEPENDENCIES github-pages jekyll + just-the-docs BUNDLED WITH 2.1.4 diff --git a/docs/Logging.md b/docs/Logging.md index 5e4fb9bc217..aafae4e8541 100644 --- a/docs/Logging.md +++ b/docs/Logging.md @@ -1,8 +1,9 @@ --- layout: page title: Logging guide +parent: For Developers +nav_order: 4 --- - * We are using `java.util.logging` package for logging. * The `LogsCenter` class is used to manage the logging levels and logging destinations. * The `Logger` for a class can be obtained using `LogsCenter.getLogger(Class)` which will log messages according to the specified logging level. diff --git a/docs/SettingUp.md b/docs/SettingUp.md index 275445bd551..5471339d440 100644 --- a/docs/SettingUp.md +++ b/docs/SettingUp.md @@ -1,6 +1,8 @@ --- layout: page -title: Setting up and getting started +title: Getting Started +parent: For Users +nav_order: 1 --- * Table of Contents @@ -45,11 +47,4 @@ 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). - -1. **Do the tutorials** - These tutorials will help you get acquainted with the codebase. - - * [Tracing code](tutorials/TracingCode.md) - * [Adding a new command](tutorials/AddRemark.md) - * [Removing fields](tutorials/RemovingFields.md) + When you are ready to start coding, we recommend that you get some sense of the overall design by reading about [BogoBogo’s architecture](DeveloperGuide.md#architecture). diff --git a/docs/Testing.md b/docs/Testing.md index 8a99e82438a..c058845fc0b 100644 --- a/docs/Testing.md +++ b/docs/Testing.md @@ -1,6 +1,8 @@ --- layout: page title: Testing guide +parent: For Developers +nav_order: 3 --- * Table of Contents diff --git a/docs/UserGuide.md b/docs/UserGuide.md index 3716f3ca8a4..794601f88bd 100644 --- a/docs/UserGuide.md +++ b/docs/UserGuide.md @@ -1,192 +1,419 @@ --- -layout: page -title: User Guide +layout: page +title: User Guide +parent: For Users +nav_order: 2 --- -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. +**BogoBogo User Guide**{: .text-purple-000 .text-alpha } -* Table of Contents +_What is BogoBogo?_{: .text-gamma} + +BogoBogo is a **desktop app for small business owners to manage inventories, 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, BogoBogo can get your +inventory management tasks done faster than traditional GUI apps. + +With BogoBogo, business owners can: + +1. manage inventories +2. record customer orders +3. track profit, costs, and revenue + +
+ + Table of contents + + {: .text-delta } +1. TOC {:toc} +
-------------------------------------------------------------------------------------------------------------------- -## Quick start +## Getting started -1. Ensure you have Java `11` or above installed in your Computer. +1 . Ensure you have Java `11` or above installed in your Computer. -1. Download the latest `addressbook.jar` from [here](https://github.com/se-edu/addressbook-level3/releases). +2 . Download the latest `BogoBogo.jar` from [here](https://github.com/AY2122S1-CS2103-F10-2/tp/releases). -1. Copy the file to the folder you want to use as the _home folder_ for your AddressBook. +3 . Move the file to the folder you want to use as the _home folder_ for the application. -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 how the app + contains some sample data.
![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.
- Some example commands you can try: - - * **`list`** : Lists all contacts. +
:bulb: +You might have to give your device permission to open BogoBogo. +
- * **`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. +5 . Let's try adding a new item! Enter the command in the command box.
- * **`delete`**`3` : Deletes the 3rd contact shown in the current list. +**`add`** `Apple id/139827 c/3 cp/1.3 sp/2.4` : Adds an apple with id 139827, cost price $1.3, and sales price $2.4, into the inventory. - * **`clear`** : Deletes all contacts. +6 . Congrats on setting up BogoBogo! Read our [features](#managing-inventory) to learn about the different commands you can + do with the application. - * **`exit`** : Exits the app. +
:bulb: +Ready to jump right into recording your inventory? Use clear to clear the sample data! +
-1. Refer to the [Features](#features) below for details of each command. +7 . To close BogoBogo, simply enter `exit` into the command box. -------------------------------------------------------------------------------------------------------------------- -## Features +## Managing Inventory + +
+ +:information_source: Notes about the command format:
+
    +
  • +

    Words in {} are the parameters to be supplied by the user.
    + e.g. in add {name}, name is a parameter which can be used as add milk.

    +
  • +
  • +

    Parameter prefixes such as sp/ and cp/ are special keywords that indicate a start of a parameter.

    +
  • +
  • +

    Parameters in () are optional.
    + e.g. in add {name} (c/{count}), the count parameter can be omitted from the command.

    +
  • +
  • +

    Items in [] with |(vertical slash) are exclusively optional (user must specify at least one of the options).
    + e.g. delete [{name} | id/{id_number}] should be supplied with either name or id number.

    +
  • +
  • +

    Items with …​ after them can be specified zero or more times.
    + e.g. [t/TAG]…​ can be used as t/popular t/baked

    +
  • +
  • +

    Prefixed parameters can be in any order.
    + e.g. id/{id number} cp/{cost price} and cp/{cost price} id/{id number} are interpreted as the same thing.

    +
  • +
  • +

    If a parameter is expected only once in the command is specified multiple times, only the last occurrence of + the parameter will be taken.
    + e.g. if you specify id/123413 id/567856, only id/567856 will be taken.

    +
  • +
  • +

    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.

    +
  • +
+
-
+### Viewing help : `help` -**:information_source: Notes about the command format:**
+Gives a quick link to this user guide. If a command word is specified, it'll explain how to use the specified command +instead. -* Words in `UPPER_CASE` are the parameters to be supplied by the user.
- e.g. in `add n/NAME`, `NAME` is a parameter which can be used as `add n/John Doe`. +Format: -* 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`. +- `help`: Shows help page url. +- `help {command}` : Explains how to use the specified command. -* 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. +Examples: -* 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. +- `help list` offers information regarding the `list` command. -* 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. +![help message](images/helpMessage.png) + +### Adding items: `add` + +Adds an item to the inventory. -* Extraneous parameters for commands that do not take in parameters (such as `help`, `list`, `exit` and `clear`) will be ignored.
- e.g. if the command specifies `help 123`, it will be interpreted as `help`. +Format: `add [{name} | id/{id number}] (c/{count}) (cp/{cost price}) (sp/{sell price}) (t/{tag})...` +Prefix | Argument | Description | Remarks | +--------|-------------- |-------------------------------|----------------------------------------------------------| +  | name | Name of the item to add. | Only alphanumeric characters (and spaces) are allowed. | +`id/` | id number | Id number of item to add. | Must be an integer with no more than 6 digits. | +`c/` | count | Quantity of the item to add. | Must be an integer, default value is 1. | +`cp/` | cost price | Cost price of the item to add.| Must be non-negative. | +`sp/` | sell price | Sell price of the item to add.| Must be non-negative. | +`t/` | tag(s) | Tags of the item to add. | Only alphanumeric characters are allowed. | + +
+:information_source: When adding an item for the first time, the name, id, cost price, and sales price must all be specified.
-### Viewing help : `help` +Examples: -Shows a message explaning how to access the help page. +- `add apple` adds an apple into the inventory. +- `add id/111111 c/2` adds 2 of item with id 111111 into the inventory. +- `add banana id/192023 cp/1.0 sp/2.2` adds a banana (id 192023) with cost price $1.0 and sales price $2.2 into the + inventory. -![help message](images/helpMessage.png) +
+:information_source: BogoBogo will get confused if different items have matching names or id. Hence, adding different items with clashing names/ids are is not supported. +
-Format: `help` +![add](images/screenshots/add_item.png) +### Deleting items : `delete` -### Adding a person: `add` +Deletes **all** the specified item from the inventory. Use this command to delete items wrongly keyed into the inventory. Costs +initially incurred from the item will be removed too. -Adds a person to the address book. +Format: `delete [{name} | id/{id number}]` -Format: `add n/NAME p/PHONE_NUMBER e/EMAIL a/ADDRESS [t/TAG]…​` +Prefix | Argument | Description | Remarks +--------|----------------|------------------------------|-------------------------------- +  | name | Name of the item to delete. | Only alphanumeric characters (and spaces) are allowed. +`id/` | id number | Id number of item to delete. | Must be an integer with no more than 6 digits. -
:bulb: **Tip:** -A person can have any number of tags (including 0) -
+- Delete the specified item entirely from the inventory. +- An item can be specified by name, id number , or both. -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` +- `delete Apple` deletes by name. +- `delete id/181817` deletes by id number. -Shows a list of all persons in the address book. +![delete](images/screenshots/delete_item.png) -Format: `list` +### Removing items : `remove` -### Editing a person : `edit` +Removes a specified amount of a particular item from the inventory. -Edits an existing person in the address book. +Format: `remove [ {name} | id/{id number} ] c/{count}` -Format: `edit INDEX [n/NAME] [p/PHONE] [e/EMAIL] [a/ADDRESS] [t/TAG]…​` +Flag | Argument | Description | Remarks | +--------|----------------|----------------------------------|-----------------------------------------| +  | name | Name of the item to remove. | Only alphanumeric characters (and spaces) are allowed. | +`id/` | id number | Id number of the item to remove. | Must be an integer with no more than 6 digits. | +`c/` | count | Quantity of the item to remove. | Must be an integer, default value is 1. | -* 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. +- An item can be specified by name, id number, or both. 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` +- `remove Apple` removes **one** apple from inventory +- `remove id/181817 c/5` removes 5 of item with id 181817 + +![remove](images/screenshots/remove_item.png) + +### Editing an item : `edit` -Finds persons whose names contain any of the given keywords. +Edit a particular item in the inventory. Note that display must be in inventory mode (see [`list`](#listing-items-list)) +. -Format: `find KEYWORD [MORE_KEYWORDS]` +Format: `edit {index} (n/{name}) (id/{id}) (cp/{cp}) (sp/{sp}) (t/{tag})...` + +Flag | Argument | Description | Remarks +--------|---------------|---------------------------------|------------------------- +  | index | index of the item to edit. | Index is 1 based. +`n/` | name | new name for the item. | Only alphanumeric characters (and spaces) are allowed. +`id/` | id number | new id number for the item. | Must be an integer with no more than 6 digits. +`cp/` | cost price | new cost price for the item. | Must be non-negative. +`sp/` | sell price | new sales price for the item. | Must be non-negative. +`t/` | tag | new tag(s) for the item. | Only alphanumeric characters are allowed. + +- Feel free to edit multiple fields at once! +- Count cannot be edited, use `add`, `delete` or `remove` instead. + +
+:exclamation: When editing tags, old tags will be overwritten! +
-* 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` +- `edit 1 id/192028` edits first item's id to 192028. +- `edit 2 n/Panadol cp/2` edits second item's name to "Panadol" and cost price to $2.0. + +![edit](images/screenshots/edit_item.png) + +### Listing items: `list` + +List items in the inventory, current order, or past transactions. + +Format: + +- `list`: List items in the inventory. +- `list order`: List items in the current order (if any). +- `list txns`: List past transactions, along with total costs, revenue and profit. +- `list txns {id}`: List items in the specified transaction. + +
+:question: Where can I find the transaction id?
+The transaction id can be found to the right of the transaction timestamp when you list txns. +
+ +![list](images/screenshots/list_items.png) + +### Sorting items: `sort` + +Sort items in the inventory. Note that display must be in inventory mode (see [`list`](#listing-items-list)). + +Format: -Deletes the specified person from the address book. +- `sort n/`: Sort items in the inventory by name. +- `sort c/`: Sort items in the inventory by count. -Format: `delete INDEX` +![sort](images/screenshots/sort_items.png) -* 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, …​ +### Finding items: `find` + +Find items in the inventory. Note that display must be in inventory mode (see [`list`](#listing-items-list)). + +Format: `find [ n/{name}... | id/{id}... | t/{tag}... ]` + +BogoBogo searches and lists items in the inventory that matches any of the specified name, id, or tag. 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. -### Clearing all entries : `clear` +- `find n/Cookie n/Apple` finds and lists items with the words "Cookie" or "Apple" in their names. +- `find id/123456` finds item with id 123456. + +![find](images/screenshots/find_item.png) + +### Clearing items and all other data: `clear` -Clears all entries from the address book. +Clears the entire inventory and all other data, i.e. bookkeeping and transaction record. Format: `clear` -### Exiting the program : `exit` +
+:exclamation: Be careful with this command! Clearing an inventory will not only clear the inventory but delete memory regarding items' details. +
+ +![clear](images/screenshots/clear.png) + +## Managing orders -Exits the program. +Orders is BogoBogo's way of tracking sold items. Users can create orders, process, and save them for later review. By +processing an order, the revenue attained will be added into total revenue which can then be used to calculate profits. + +
+:exclamation: Be sure not to close BogoBogo without saving your order! Any unsaved order will be lost. +
-Format: `exit` +The workflow of the order system is as follows: +* Use `sorder` to enter ordering mode. +* Use `iorder` to add items into your order. +* Use `corder` to remove items from your order. +* Use `eorder` to place your order. +* Use `list order` to see current items in your order (see [`list`](#listing-items-list)). -### Saving the data +![mange orders workflow](images/manageOrdersWorkflow.png) -AddressBook data are saved in the hard disk automatically after any command that changes the data. There is no need to save manually. +### Start ordering: `sorder` -### Editing the data file +Starts a new order and enters ordering mode. -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. +Format: `sorder` -
: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. +![sorder](images/screenshots/sorder.png) + +### Adding an item into order: `iorder` + +Add an item into the current order. BogoBogo will let you know if there isn't enough items in the inventory to fulfill +the order request. + +
+:bulb: Once having added items, you can view your current order with list order.
-### Archiving data files `[coming in v2.0]` +Format: +`iorder [ {name} | id/{id} ] (c/{count})` + +Flag | Argument | Description | Remarks | +--------|----------------|----------------------------------------|-------------------------------------------------| +  | name | Name of the item to add to order. | Only alphanumeric characters (and spaces) are allowed. | +`id/` | id number | Id number of the item to add to order. | Must be an integer with no more than 6 digits. | +`c/` | count | Quantity of the item to add to order. | Must be a positive integer, default value is 1. | + +Examples: + +- `iorder milk c/5` Adds 5x milk into the current order. +- `iorder id/12345` Adds 1x item with id 12345 into the current order. + +![iorder](images/screenshots/iorder.png) + +### Cancelling an item in the order: `corder` -_Details coming soon ..._ +Cancels the specified order from the current order. + +Format: +`corder [ {name} | id/{id} ] (c/count)` + +Flag | Argument | Description | Remarks | +--------|----------------|---------------------------------------------|-------------------------------------------------| +  | name | Name of the item to remove from order. | Only alphanumeric characters (and spaces) are allowed. | +`id/` | id number | Id number of the item to remove from order. | Must be an integer with no more than 6 digits. | +`c/` | count | Quantity of the item to remove from order. | Must be a positive integer, default value is 1. | + +Examples: + +- `corder milk c/5` Removes 5x milk from the order. +- `corder id/12345` Removes 1x item with id 12345 from the order. + +![corder](images/screenshots/corder.png) + +### End ordering: `eorder` + +Processes the current order and saves it. + +Format: `eorder` + +![eorder](images/screenshots/eorder.png) -------------------------------------------------------------------------------------------------------------------- ## 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. +**Q**: What is total profit, cost and revenue?
+**A**: Total cost is the total amount of money incurred from adding items to the inventory. Revenue is the total amount +of money gained from successfully receiving orders and selling items. Profit = Revenue - Cost. + +**Q**: I just started using the app. Why is there a lot of cost incurred in my bookkeeping?
+**A**: When you use the app for the first time, it comes with sample inventory, and the bookkeeping will reflect the costs +of the items inside this sample inventory. If you would like to start afresh, please use the `clear` command. + +**Q**: What's the difference between remove and delete?
+**A**: `delete` is meant for items wrongly added into the inventory. BogoBogo retracts an item cost when an item +is deleted. `remove`, on the other hand, is for items added but not sold (e.g. expired goods). Because the item is +correctly added, cost is still incurred. + +
+:exclamation: BogoBogo only retracts the costs of unsold items. If items are sold, cost will forever be incurred! +
+ +**Q**: I have edited the cost price of my item. Why isn't the change reflected in my total cost?
+**A**: BogoBogo adds the cost of an item to the total cost only upon the addition of the item into the inventory. Any +changes to cost price is assumed to be for future restocking of the item.
+ +**Q**: Why can't I edit the count of an item with `edit`?
+**A**: Due to the calculation of total cost and revenue, BogoBogo needs to know the reason for the change in count. +Use `add` for stocking items, `delete` to delete accidentally added items, `remove` to remove unsold items (e.g. expired +goods), and `iorder` to account for sold items. + +**Q**: Why does `find t/baked t/popular` still show items that only have `t/baked` as a tag (not both)?
+**A**: `find t/baked t/popular` means "please find items that have either baked OR popular as a tag", not "please find +items that have both baked AND popular as tags" + +**Q**: Why can't I see my cost prices in my past transactions?
+**A**: Past transactions only store important transaction related details. Storing cost price can be misleading since costs can change over time! +**Q**: My business is really growing lately, why does my BogoBogo calculation of revenue, profit, and cost seem wrong?
+**A**: BogoBogo was built for small businesses in mind. On that note, it doesn't calculate revenue and cost beyond $999,999,999. +Consider hiring an accountant, you billionaire! -------------------------------------------------------------------------------------------------------------------- ## 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` +- **Viewing Help**: `help ({command})` +- **Add Item**: `add [{name} | id/{id number}] (c/{count}) (cp/{cost price}) (sp/{sell price}) (t/{tag})...` +- **Delete Item**: `delete [{name} | id/{id number}]` +- **Remove Item**: `remove [ {name} | id/{id number} ] c/{count}` +- **List**: `list [ order | txns | txns {id} ]` +- **Sort Items**: `sort n/` or `sort c/` +- **Find Items**: `find [ n/{name}... | id/{id}... | t/{tag}... ]` +- **Clearing Items and All Data**: `clear` +- **Start an order**: `sorder` +- **Add item to order**: `iorder [ {name} | id/{id} ] (c/{count})` +- **Remove item from order**: `corder [ {name} | id/{id} ] (c/count)` +- **End the order**: `eorder` +- **Exit BogoBogo**:`exit` diff --git a/docs/_config.yml b/docs/_config.yml index 6bd245d8f4e..17dcf3066a4 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -1,5 +1,6 @@ -title: "AB-3" -theme: minima +title: "BogoBogo" +remote_theme: pmarsceill/just-the-docs #Comment this out when working locally +#theme: "just-the-docs" #Commmen this out when working remotely header_pages: - UserGuide.md @@ -8,7 +9,7 @@ header_pages: markdown: kramdown -repository: "se-edu/addressbook-level3" +repository: "AY2122S1-CS2103-F10-2/tp" github_icon: "images/github-icon.png" plugins: diff --git a/docs/_includes/custom-head.html b/docs/_includes/custom-head.html deleted file mode 100644 index 8559a67ffad..00000000000 --- a/docs/_includes/custom-head.html +++ /dev/null @@ -1,6 +0,0 @@ -{% comment %} - Placeholder to allow defining custom head, in principle, you can add anything here, e.g. favicons: - - 1. Head over to https://realfavicongenerator.net/ to add your own favicons. - 2. Customize default _includes/custom-head.html in your source directory and insert the given code snippet. -{% endcomment %} diff --git a/docs/_includes/head.html b/docs/_includes/head.html deleted file mode 100644 index 83ac5326933..00000000000 --- a/docs/_includes/head.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - {%- include custom-head.html -%} - - {{page.title}} - - diff --git a/docs/_includes/header.html b/docs/_includes/header.html deleted file mode 100644 index 33badcd4f99..00000000000 --- a/docs/_includes/header.html +++ /dev/null @@ -1,36 +0,0 @@ - diff --git a/docs/_layouts/alt-page.html b/docs/_layouts/alt-page.html deleted file mode 100644 index 5dbc6ef245f..00000000000 --- a/docs/_layouts/alt-page.html +++ /dev/null @@ -1,14 +0,0 @@ ---- -layout: default ---- -
- -
-

{{ page.alt_title | escape }}

-
- -
- {{ content }} -
- -
diff --git a/docs/_layouts/default.html b/docs/_layouts/default.html deleted file mode 100644 index e092cd572e0..00000000000 --- a/docs/_layouts/default.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - {%- include head.html -%} - - - - {%- include header.html -%} - -
-
- {{ content }} -
-
- - - - diff --git a/docs/_layouts/page.html b/docs/_layouts/page.html deleted file mode 100644 index 01e4b2a93b8..00000000000 --- a/docs/_layouts/page.html +++ /dev/null @@ -1,14 +0,0 @@ ---- -layout: default ---- -
- -
-

{{ page.title | escape }}

-
- -
- {{ content }} -
- -
diff --git a/docs/_sass/minima/_base.scss b/docs/_sass/minima/_base.scss deleted file mode 100644 index 0d3f6e80ced..00000000000 --- a/docs/_sass/minima/_base.scss +++ /dev/null @@ -1,295 +0,0 @@ -html { - font-size: $base-font-size; -} - -/** - * Reset some basic elements - */ -body, h1, h2, h3, h4, h5, h6, -p, blockquote, pre, hr, -dl, dd, ol, ul, figure { - margin: 0; - padding: 0; - -} - - - -/** - * Basic styling - */ -body { - font: $base-font-weight #{$base-font-size}/#{$base-line-height} $base-font-family; - color: $text-color; - background-color: $background-color; - -webkit-text-size-adjust: 100%; - -webkit-font-feature-settings: "kern" 1; - -moz-font-feature-settings: "kern" 1; - -o-font-feature-settings: "kern" 1; - font-feature-settings: "kern" 1; - font-kerning: normal; - display: flex; - min-height: 100vh; - flex-direction: column; - overflow-wrap: break-word; -} - - - -/** - * Set `margin-bottom` to maintain vertical rhythm - */ -h1, h2, h3, h4, h5, h6, -p, blockquote, pre, -ul, ol, dl, figure, -%vertical-rhythm { - margin-bottom: $spacing-unit / 2; -} - -hr { - margin-top: $spacing-unit; - margin-bottom: $spacing-unit; -} - -/** - * `main` element - */ -main { - display: block; /* Default value of `display` of `main` element is 'inline' in IE 11. */ -} - - - -/** - * Images - */ -img { - max-width: 100%; - vertical-align: middle; -} - - - -/** - * Figures - */ -figure > img { - display: block; -} - -figcaption { - font-size: $small-font-size; -} - - - -/** - * Lists - */ -ul, ol { - margin-left: $spacing-unit; -} - -li { - > ul, - > ol { - margin-bottom: 0; - } -} - - - -/** - * Headings - */ -h1, h2, h3, h4, h5, h6 { - font-weight: $base-font-weight; -} - - - -/** - * Links - */ -a { - color: $link-base-color; - text-decoration: none; - - &:visited { - color: $link-visited-color; - } - - &:hover { - color: $text-color; - text-decoration: underline; - } - - .social-media-list &:hover { - text-decoration: none; - - .username { - text-decoration: underline; - } - } -} - - -/** - * Blockquotes - */ -blockquote { - color: $brand-color; - border-left: 4px solid $brand-color-light; - padding-left: $spacing-unit / 2; - @include relative-font-size(1.125); - font-style: italic; - - > :last-child { - margin-bottom: 0; - } - - i, em { - font-style: normal; - } -} - - - -/** - * Code formatting - */ -pre, -code { - font-family: $code-font-family; - font-size: 0.9375em; - border: 1px solid $brand-color-light; - border-radius: 3px; - background-color: $code-background-color; -} - -code { - padding: 1px 5px; -} - -pre { - padding: 8px 12px; - overflow-x: auto; - - > code { - border: 0; - padding-right: 0; - padding-left: 0; - } -} - -.highlight { - border-radius: 3px; - background: $code-background-color; - @extend %vertical-rhythm; - - .highlighter-rouge & { - background: $code-background-color; - } -} - - - -/** - * Wrapper - */ -.wrapper { - max-width: calc(#{$content-width} - (#{$spacing-unit})); - margin-right: auto; - margin-left: auto; - padding-right: $spacing-unit / 2; - padding-left: $spacing-unit / 2; - @extend %clearfix; - - @media screen and (min-width: $on-large) { - max-width: calc(#{$content-width} - (#{$spacing-unit} * 2)); - padding-right: $spacing-unit; - padding-left: $spacing-unit; - } -} - - - -/** - * Clearfix - */ -%clearfix:after { - content: ""; - display: table; - clear: both; -} - - - -/** - * Icons - */ - -.orange { - color: #f66a0a; -} - -.grey { - color: #828282; -} - -/** - * Tables - */ -table { - margin-bottom: $spacing-unit; - width: 100%; - text-align: $table-text-align; - color: $table-text-color; - border-collapse: collapse; - border: 1px solid $table-border-color; - tr { - &:nth-child(even) { - background-color: $table-zebra-color; - } - } - th, td { - padding: ($spacing-unit / 3) ($spacing-unit / 2); - } - th { - background-color: $table-header-bg-color; - border: 1px solid $table-header-border; - } - td { - border: 1px solid $table-border-color; - } - - @include media-query($on-laptop) { - display: block; - overflow-x: auto; - -webkit-overflow-scrolling: touch; - -ms-overflow-style: -ms-autohiding-scrollbar; - } -} - -@media print { - /** - * Prevents page break from cutting through content when printing - */ - body { - display: block; - } - /** - * Replaces the top navigation menu with the project name when printing - */ - .site-header .wrapper { - display: none; - } - .site-header { - text-align: center; - } - .site-header:before { - content: "AB-3"; - font-size: 32px; - } -} - diff --git a/docs/_sass/minima/_layout.scss b/docs/_sass/minima/_layout.scss deleted file mode 100644 index ca99f981701..00000000000 --- a/docs/_sass/minima/_layout.scss +++ /dev/null @@ -1,263 +0,0 @@ -/** - * Site header - */ -.site-header { - border-top: 5px solid $brand-color-dark; - border-bottom: 1px solid $brand-color-light; - min-height: $spacing-unit * 1.865; - line-height: $base-line-height * $base-font-size * 2.25; - - // Positioning context for the mobile navigation icon - position: relative; -} - -.site-title { - @include relative-font-size(1.625); - font-weight: 300; - letter-spacing: -1px; - margin-bottom: 0; - float: left; - - @include media-query($on-palm) { - padding-right: 45px; - } - - &, - &:visited { - color: $brand-color-dark; - } -} - -.site-nav { - position: absolute; - top: 9px; - right: $spacing-unit / 2; - background-color: $background-color; - border: 1px solid $brand-color-light; - border-radius: 5px; - text-align: right; - - .nav-trigger { - display: none; - } - - .menu-icon { - float: right; - width: 36px; - height: 26px; - line-height: 0; - padding-top: 10px; - text-align: center; - - > svg path { - fill: $brand-color-dark; - } - } - - label[for="nav-trigger"] { - display: block; - float: right; - width: 36px; - height: 36px; - z-index: 2; - cursor: pointer; - } - - input ~ .trigger { - clear: both; - display: none; - } - - input:checked ~ .trigger { - display: block; - padding-bottom: 5px; - } - - .page-link { - color: $text-color; - line-height: $base-line-height; - display: block; - padding: 5px 10px; - - // Gaps between nav items, but not on the last one - &:not(:last-child) { - margin-right: 0; - } - margin-left: 20px; - } - - @media screen and (min-width: $on-medium) { - position: static; - float: right; - border: none; - background-color: inherit; - - label[for="nav-trigger"] { - display: none; - } - - .menu-icon { - display: none; - } - - input ~ .trigger { - display: block; - } - - .page-link { - display: inline; - padding: 0; - - &:not(:last-child) { - margin-right: 20px; - } - margin-left: auto; - } - } -} - - - -/** - * Page content - */ -.page-content { - padding: $spacing-unit 0; - flex: 1 0 auto; -} - -.page-heading { - @include relative-font-size(2); -} - -.post-list-heading { - @include relative-font-size(1.75); -} - -.post-list { - margin-left: 0; - list-style: none; - - > li { - margin-bottom: $spacing-unit; - } -} - -.post-meta { - font-size: $small-font-size; - color: $brand-color; -} - -.post-link { - display: block; - @include relative-font-size(1.5); -} - - - -/** - * Posts - */ -.post-header { - margin-bottom: $spacing-unit; -} - -.post-title, -.post-content h1 { - @include relative-font-size(2.625); - letter-spacing: -1px; - line-height: 1.15; - - @media screen and (min-width: $on-large) { - @include relative-font-size(2.625); - } -} - -.post-content { - margin-bottom: $spacing-unit; - - h1, h2, h3 { margin-top: $spacing-unit * 2 } - h4, h5, h6 { margin-top: $spacing-unit } - - h2 { - @include relative-font-size(1.75); - - @media screen and (min-width: $on-large) { - @include relative-font-size(2); - } - } - - h3 { - @include relative-font-size(1.375); - - @media screen and (min-width: $on-large) { - @include relative-font-size(1.625); - } - } - - h4 { - @include relative-font-size(1.25); - } - - h5 { - @include relative-font-size(1.125); - } - h6 { - @include relative-font-size(1.0625); - } -} - - -.social-media-list { - display: table; - margin: 0 auto; - li { - float: left; - margin: 5px 10px 5px 0; - &:last-of-type { margin-right: 0 } - a { - display: block; - padding: $spacing-unit / 4; - border: 1px solid $brand-color-light; - &:hover { border-color: darken($brand-color-light, 10%) } - } - } -} - - - -/** - * Pagination navbar - */ -.pagination { - margin-bottom: $spacing-unit; - @extend .social-media-list; - li { - a, div { - min-width: 41px; - text-align: center; - box-sizing: border-box; - } - div { - display: block; - padding: $spacing-unit / 4; - border: 1px solid transparent; - - &.pager-edge { - color: darken($brand-color-light, 5%); - border: 1px dashed; - } - } - } -} - - - -/** - * Grid helpers - */ -@media screen and (min-width: $on-large) { - .one-half { - width: calc(50% - (#{$spacing-unit} / 2)); - } -} diff --git a/docs/_sass/minima/custom-mixins.scss b/docs/_sass/minima/custom-mixins.scss deleted file mode 100644 index 9d4bedc1c67..00000000000 --- a/docs/_sass/minima/custom-mixins.scss +++ /dev/null @@ -1,21 +0,0 @@ -@mixin alert-variant($background, $border, $color) { - color: $color; - @include gradient-bg($background); - border-color: $border; - - .alert-link { - color: darken($color, 10%); - } -} - -@mixin gradient-bg($color, $foreground: null) { - @if $enable-gradients { - @if $foreground { - background-image: $foreground, linear-gradient(180deg, mix($body-bg, $color, 15%), $color); - } @else { - background-image: linear-gradient(180deg, mix($body-bg, $color, 15%), $color); - } - } @else { - background-color: $color; - } -} diff --git a/docs/_sass/minima/custom-styles.scss b/docs/_sass/minima/custom-styles.scss deleted file mode 100644 index a992115a70f..00000000000 --- a/docs/_sass/minima/custom-styles.scss +++ /dev/null @@ -1,34 +0,0 @@ -// Placeholder to allow defining custom styles that override everything else. -// (Use `_sass/minima/custom-variables.scss` to override variable defaults) -h2, h3, h4, h5, h6 { - color: #e46c0a; -} - -// Bootstrap style alerts -.alert { - position: relative; - padding: $alert-padding-y $alert-padding-x; - margin-bottom: $alert-margin-bottom; - border: $alert-border-width solid transparent; - order-radius : $alert-border-radius; -} - -// Headings for larger alerts -.alert-heading { - // Specified to prevent conflicts of changing $headings-color - color: inherit; -} - -// Provide class for links that match alerts -.alert-link { - font-weight: $alert-link-font-weight; -} - -// Generate contextual modifier classes for colorizing the alert. - -@each $color, $value in $theme-colors { - .alert-#{$color} { - @include alert-variant(color-level($value, $alert-bg-level), color-level($value, $alert-border-level), color-level($value, $alert-color-level)); - } -} - diff --git a/docs/_sass/minima/custom-variables.scss b/docs/_sass/minima/custom-variables.scss deleted file mode 100644 index a128970cbe7..00000000000 --- a/docs/_sass/minima/custom-variables.scss +++ /dev/null @@ -1,76 +0,0 @@ -// Placeholder to allow overriding predefined variables smoothly. - -//Bootstrap's default -$white: #fff !default; -$gray-100: #f8f9fa !default; -$gray-200: #e9ecef !default; -$gray-300: #dee2e6 !default; -$gray-400: #ced4da !default; -$gray-500: #adb5bd !default; -$gray-600: #6c757d !default; -$gray-700: #495057 !default; -$gray-800: #343a40 !default; -$gray-900: #212529 !default; -$black: #000 !default; -$blue: #0d6efd !default; -$indigo: #6610f2 !default; -$purple: #6f42c1 !default; -$pink: #d63384 !default; -$red: #dc3545 !default; -$orange: #fd7e14 !default; -$yellow: #ffc107 !default; -$green: #28a745 !default; -$teal: #20c997 !default; -$cyan: #17a2b8 !default; - -$primary: $blue !default; -$secondary: $gray-600 !default; -$success: $green !default; -$info: $cyan !default; -$warning: $yellow !default; -$danger: $red !default; -$light: $gray-100 !default; -$dark: $gray-800 !default; - -$theme-colors: ( - "primary": $primary, - "secondary": $secondary, - "success": $success, - "info": $info, - "warning": $warning, - "danger": $danger, - "light": $light, - "dark": $dark -) !default; - -$theme-color-interval: 8% !default; - -$body-bg: $white !default; -$body-color: $gray-900 !default; -$body-text-align: null !default; - -$enable-gradients: true; - -// Define alert colors, border radius, and padding. -$border-radius: .25rem !default; -$border-width: 1px !default; -$font-weight-bold: 700 !default; - -$alert-padding-y: .75rem !default; -$alert-padding-x: 1.25rem !default; -$alert-margin-bottom: 1rem !default; -$alert-border-radius: $border-radius !default; -$alert-link-font-weight: $font-weight-bold !default; -$alert-border-width: $border-width !default; - -$alert-bg-level: -10 !default; -$alert-border-level: -9 !default; -$alert-color-level: 6 !default; - -// Request a color level -// scss-docs-start color-level -@function color-level($color: $primary, $level: 0) { - $color-base: if($level > 0, $black, $white); - $level: abs($level); - @return mix($color-base, $color, $level * $theme-color-interval); -} diff --git a/docs/_sass/minima/initialize.scss b/docs/_sass/minima/initialize.scss deleted file mode 100644 index 30288811151..00000000000 --- a/docs/_sass/minima/initialize.scss +++ /dev/null @@ -1,51 +0,0 @@ -@charset "utf-8"; - -// Define defaults for each variable. - -$base-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Segoe UI Symbol", "Segoe UI Emoji", "Apple Color Emoji", Roboto, Helvetica, Arial, sans-serif !default; -$code-font-family: "Menlo", "Inconsolata", "Consolas", "Roboto Mono", "Ubuntu Mono", "Liberation Mono", "Courier New", monospace; -$base-font-size: 16px !default; -$base-font-weight: 400 !default; -$small-font-size: $base-font-size * 0.875 !default; -$base-line-height: 1.5 !default; - -$spacing-unit: 30px !default; - -$table-text-align: left !default; - -// Width of the content area -$content-width: 800px !default; - -$on-palm: 600px !default; -$on-laptop: 800px !default; - -$on-medium: $on-palm !default; -$on-large: $on-laptop !default; - -// Use media queries like this: -// @include media-query($on-palm) { -// .wrapper { -// padding-right: $spacing-unit / 2; -// padding-left: $spacing-unit / 2; -// } -// } -// Notice the following mixin uses max-width, in a deprecated, desktop-first -// approach, whereas media queries used elsewhere now use min-width. -@mixin media-query($device) { - @media screen and (max-width: $device) { - @content; - } -} - -@mixin relative-font-size($ratio) { - font-size: #{$ratio}rem; -} - -// Import pre-styling-overrides hook and style-partials. -@import - "minima/custom-variables", // Hook to override predefined variables. - "minima/custom-mixins", // Hook to add custom mixins. - "minima/base", // Defines element resets. - "minima/layout", // Defines structure and style based on CSS selectors. - "minima/custom-styles" // Hook to override existing styles. -; diff --git a/docs/_sass/minima/skins/classic.scss b/docs/_sass/minima/skins/classic.scss deleted file mode 100644 index 37ea9c5244c..00000000000 --- a/docs/_sass/minima/skins/classic.scss +++ /dev/null @@ -1,84 +0,0 @@ -@charset "utf-8"; - -$brand-color: #828282 !default; -$brand-color-light: lighten($brand-color, 40%) !default; -$brand-color-dark: darken($brand-color, 25%) !default; - -$text-color: #111 !default; -$background-color: #fdfdfd !default; -$code-background-color: #eef !default; - -$link-base-color: #2a7ae2 !default; -$link-visited-color: darken($link-base-color, 15%) !default; - -$table-text-color: lighten($text-color, 18%) !default; -$table-zebra-color: lighten($brand-color, 46%) !default; -$table-header-bg-color: lighten($brand-color, 43%) !default; -$table-header-border: lighten($brand-color, 36%) !default; -$table-border-color: $brand-color-light !default; - - -// Syntax highlighting styles should be adjusted appropriately for every "skin" -// ---------------------------------------------------------------------------- - -.highlight { - .c { color: #998; font-style: italic } // Comment - .err { color: #a61717; background-color: #e3d2d2 } // Error - .k { font-weight: bold } // Keyword - .o { font-weight: bold } // Operator - .cm { color: #998; font-style: italic } // Comment.Multiline - .cp { color: #999; font-weight: bold } // Comment.Preproc - .c1 { color: #998; font-style: italic } // Comment.Single - .cs { color: #999; font-weight: bold; font-style: italic } // Comment.Special - .gd { color: #000; background-color: #fdd } // Generic.Deleted - .gd .x { color: #000; background-color: #faa } // Generic.Deleted.Specific - .ge { font-style: italic } // Generic.Emph - .gr { color: #a00 } // Generic.Error - .gh { color: #999 } // Generic.Heading - .gi { color: #000; background-color: #dfd } // Generic.Inserted - .gi .x { color: #000; background-color: #afa } // Generic.Inserted.Specific - .go { color: #888 } // Generic.Output - .gp { color: #555 } // Generic.Prompt - .gs { font-weight: bold } // Generic.Strong - .gu { color: #aaa } // Generic.Subheading - .gt { color: #a00 } // Generic.Traceback - .kc { font-weight: bold } // Keyword.Constant - .kd { font-weight: bold } // Keyword.Declaration - .kp { font-weight: bold } // Keyword.Pseudo - .kr { font-weight: bold } // Keyword.Reserved - .kt { color: #458; font-weight: bold } // Keyword.Type - .m { color: #099 } // Literal.Number - .s { color: #d14 } // Literal.String - .na { color: #008080 } // Name.Attribute - .nb { color: #0086B3 } // Name.Builtin - .nc { color: #458; font-weight: bold } // Name.Class - .no { color: #008080 } // Name.Constant - .ni { color: #800080 } // Name.Entity - .ne { color: #900; font-weight: bold } // Name.Exception - .nf { color: #900; font-weight: bold } // Name.Function - .nn { color: #555 } // Name.Namespace - .nt { color: #000080 } // Name.Tag - .nv { color: #008080 } // Name.Variable - .ow { font-weight: bold } // Operator.Word - .w { color: #bbb } // Text.Whitespace - .mf { color: #099 } // Literal.Number.Float - .mh { color: #099 } // Literal.Number.Hex - .mi { color: #099 } // Literal.Number.Integer - .mo { color: #099 } // Literal.Number.Oct - .sb { color: #d14 } // Literal.String.Backtick - .sc { color: #d14 } // Literal.String.Char - .sd { color: #d14 } // Literal.String.Doc - .s2 { color: #d14 } // Literal.String.Double - .se { color: #d14 } // Literal.String.Escape - .sh { color: #d14 } // Literal.String.Heredoc - .si { color: #d14 } // Literal.String.Interpol - .sx { color: #d14 } // Literal.String.Other - .sr { color: #009926 } // Literal.String.Regex - .s1 { color: #d14 } // Literal.String.Single - .ss { color: #990073 } // Literal.String.Symbol - .bp { color: #999 } // Name.Builtin.Pseudo - .vc { color: #008080 } // Name.Variable.Class - .vg { color: #008080 } // Name.Variable.Global - .vi { color: #008080 } // Name.Variable.Instance - .il { color: #099 } // Literal.Number.Integer.Long -} diff --git a/docs/_sass/minima/skins/solarized-dark.scss b/docs/_sass/minima/skins/solarized-dark.scss deleted file mode 100644 index f3b1f387de0..00000000000 --- a/docs/_sass/minima/skins/solarized-dark.scss +++ /dev/null @@ -1,4 +0,0 @@ -@charset "utf-8"; - -$sol-is-dark: true; -@import "minima/skins/solarized"; diff --git a/docs/_sass/minima/skins/solarized.scss b/docs/_sass/minima/skins/solarized.scss deleted file mode 100644 index 982bd7f2990..00000000000 --- a/docs/_sass/minima/skins/solarized.scss +++ /dev/null @@ -1,133 +0,0 @@ -@charset "utf-8"; - -// Solarized skin -// ============== -// Created by Sander Voerman using the Solarized -// color scheme by Ethan Schoonover . - -// This style sheet implements two options for the minima.skin setting: -// "solarized" for light mode and "solarized-dark" for dark mode. -$sol-is-dark: false !default; - - -// Color scheme -// ------------ -// The inline comments show the canonical L*a*b values for each color. - -$sol-base03: #002b36; // 15 -12 -12 -$sol-base02: #073642; // 20 -12 -12 -$sol-base01: #586e75; // 45 -07 -07 -$sol-base00: #657b83; // 50 -07 -07 -$sol-base0: #839496; // 60 -06 -03 -$sol-base1: #93a1a1; // 65 -05 -02 -$sol-base2: #eee8d5; // 92 -00 10 -$sol-base3: #fdf6e3; // 97 00 10 -$sol-yellow: #b58900; // 60 10 65 -$sol-orange: #cb4b16; // 50 50 55 -$sol-red: #dc322f; // 50 65 45 -$sol-magenta: #d33682; // 50 65 -05 -$sol-violet: #6c71c4; // 50 15 -45 -$sol-blue: #268bd2; // 55 -10 -45 -$sol-cyan: #2aa198; // 60 -35 -05 -$sol-green: #859900; // 60 -20 65 - -$sol-mono3: $sol-base3; -$sol-mono2: $sol-base2; -$sol-mono1: $sol-base1; -$sol-mono00: $sol-base00; -$sol-mono01: $sol-base01; - -@if $sol-is-dark { - $sol-mono3: $sol-base03; - $sol-mono2: $sol-base02; - $sol-mono1: $sol-base01; - $sol-mono00: $sol-base0; - $sol-mono01: $sol-base1; -} - - -// Minima color variables -// ---------------------- - -$brand-color: $sol-mono1 !default; -$brand-color-light: mix($sol-mono1, $sol-mono3) !default; -$brand-color-dark: $sol-mono00 !default; - -$text-color: $sol-mono01 !default; -$background-color: $sol-mono3 !default; -$code-background-color: $sol-mono2 !default; - -$link-base-color: $sol-blue !default; -$link-visited-color: mix($sol-blue, $sol-mono00) !default; - -$table-text-color: $sol-mono00 !default; -$table-zebra-color: mix($sol-mono2, $sol-mono3) !default; -$table-header-bg-color: $sol-mono2 !default; -$table-header-border: $sol-mono1 !default; -$table-border-color: $sol-mono1 !default; - - -// Syntax highlighting styles -// -------------------------- - -.highlight { - .c { color: $sol-mono1; font-style: italic } // Comment - .err { color: $sol-red } // Error - .k { color: $sol-mono01; font-weight: bold } // Keyword - .o { color: $sol-mono01; font-weight: bold } // Operator - .cm { color: $sol-mono1; font-style: italic } // Comment.Multiline - .cp { color: $sol-mono1; font-weight: bold } // Comment.Preproc - .c1 { color: $sol-mono1; font-style: italic } // Comment.Single - .cs { color: $sol-mono1; font-weight: bold; font-style: italic } // Comment.Special - .gd { color: $sol-red } // Generic.Deleted - .gd .x { color: $sol-red } // Generic.Deleted.Specific - .ge { color: $sol-mono00; font-style: italic } // Generic.Emph - .gr { color: $sol-red } // Generic.Error - .gh { color: $sol-mono1 } // Generic.Heading - .gi { color: $sol-green } // Generic.Inserted - .gi .x { color: $sol-green } // Generic.Inserted.Specific - .go { color: $sol-mono00 } // Generic.Output - .gp { color: $sol-mono00 } // Generic.Prompt - .gs { color: $sol-mono01; font-weight: bold } // Generic.Strong - .gu { color: $sol-mono1 } // Generic.Subheading - .gt { color: $sol-red } // Generic.Traceback - .kc { color: $sol-mono01; font-weight: bold } // Keyword.Constant - .kd { color: $sol-mono01; font-weight: bold } // Keyword.Declaration - .kp { color: $sol-mono01; font-weight: bold } // Keyword.Pseudo - .kr { color: $sol-mono01; font-weight: bold } // Keyword.Reserved - .kt { color: $sol-violet; font-weight: bold } // Keyword.Type - .m { color: $sol-cyan } // Literal.Number - .s { color: $sol-magenta } // Literal.String - .na { color: $sol-cyan } // Name.Attribute - .nb { color: $sol-blue } // Name.Builtin - .nc { color: $sol-violet; font-weight: bold } // Name.Class - .no { color: $sol-cyan } // Name.Constant - .ni { color: $sol-violet } // Name.Entity - .ne { color: $sol-violet; font-weight: bold } // Name.Exception - .nf { color: $sol-blue; font-weight: bold } // Name.Function - .nn { color: $sol-mono00 } // Name.Namespace - .nt { color: $sol-blue } // Name.Tag - .nv { color: $sol-cyan } // Name.Variable - .ow { color: $sol-mono01; font-weight: bold } // Operator.Word - .w { color: $sol-mono1 } // Text.Whitespace - .mf { color: $sol-cyan } // Literal.Number.Float - .mh { color: $sol-cyan } // Literal.Number.Hex - .mi { color: $sol-cyan } // Literal.Number.Integer - .mo { color: $sol-cyan } // Literal.Number.Oct - .sb { color: $sol-magenta } // Literal.String.Backtick - .sc { color: $sol-magenta } // Literal.String.Char - .sd { color: $sol-magenta } // Literal.String.Doc - .s2 { color: $sol-magenta } // Literal.String.Double - .se { color: $sol-magenta } // Literal.String.Escape - .sh { color: $sol-magenta } // Literal.String.Heredoc - .si { color: $sol-magenta } // Literal.String.Interpol - .sx { color: $sol-magenta } // Literal.String.Other - .sr { color: $sol-green } // Literal.String.Regex - .s1 { color: $sol-magenta } // Literal.String.Single - .ss { color: $sol-magenta } // Literal.String.Symbol - .bp { color: $sol-mono1 } // Name.Builtin.Pseudo - .vc { color: $sol-cyan } // Name.Variable.Class - .vg { color: $sol-cyan } // Name.Variable.Global - .vi { color: $sol-cyan } // Name.Variable.Instance - .il { color: $sol-cyan } // Literal.Number.Integer.Long -} diff --git a/docs/assets/css/style.scss b/docs/assets/css/style.scss deleted file mode 100644 index b5ec6976efa..00000000000 --- a/docs/assets/css/style.scss +++ /dev/null @@ -1,12 +0,0 @@ ---- -# Only the main Sass file needs front matter (the dashes are enough) ---- - -@import - "minima/skins/{{ site.minima.skin | default: 'classic' }}", - "minima/initialize"; - -.icon { - height: 21px; - width: 21px -} diff --git a/docs/diagrams/AddSequenceDiagram.puml b/docs/diagrams/AddSequenceDiagram.puml new file mode 100644 index 00000000000..c3d6ddd2f5b --- /dev/null +++ b/docs/diagrams/AddSequenceDiagram.puml @@ -0,0 +1,39 @@ +@startuml +!include style.puml + +participant ":AddCommand" as AddCommand LOGIC_COLOR +participant ":ModelManager" as ModelManager MODEL_COLOR +participant ":Inventory" as Inventory MODEL_COLOR +participant ":DisplayList" as DisplayList MODEL_COLOR + +--> AddCommand : execute() +activate AddCommand + +AddCommand --> ModelManager : addItem(newItem) +activate ModelManager + +ModelManager --> Inventory : addItem(newItem) +activate Inventory + +Inventory --> ModelManager +deactivate Inventory + +ModelManager --> ModelManager : updateFilteredItemList() +activate ModelManager + +ModelManager --> DisplayList : setItems(itemList) +activate DisplayList + +DisplayList --> ModelManager +deactivate DisplayList + +ModelManager --> ModelManager +deactivate ModelManager + +ModelManager --> AddCommand +deactivate ModelManager + +<-- AddCommand +deactivate AddCommand + +@enduml diff --git a/docs/diagrams/ArchitectureSequenceDiagram.puml b/docs/diagrams/ArchitectureSequenceDiagram.puml index ef81d18c337..632d085b383 100644 --- a/docs/diagrams/ArchitectureSequenceDiagram.puml +++ b/docs/diagrams/ArchitectureSequenceDiagram.puml @@ -7,19 +7,19 @@ 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 Milk -c 5" activate ui UI_COLOR -ui -[UI_COLOR]> logic : execute("delete 1") +ui -[UI_COLOR]> logic : execute("delete Milk -c 5") activate logic LOGIC_COLOR -logic -[LOGIC_COLOR]> model : deletePerson(p) +logic -[LOGIC_COLOR]> model : deleteItem(item) activate model MODEL_COLOR model -[MODEL_COLOR]-> logic deactivate model -logic -[LOGIC_COLOR]> storage : saveAddressBook(addressBook) +logic -[LOGIC_COLOR]> storage : saveInventory() activate storage STORAGE_COLOR storage -[STORAGE_COLOR]> storage : Save to file diff --git a/docs/diagrams/AutocompleteActivityDiagram.puml b/docs/diagrams/AutocompleteActivityDiagram.puml new file mode 100644 index 00000000000..8178fa9f065 --- /dev/null +++ b/docs/diagrams/AutocompleteActivityDiagram.puml @@ -0,0 +1,20 @@ +@startuml + +skinparam defaultTextAlignment center + +start +:User inputs command; + +switch() +case ( User enters command) + :BogoBogo handles command; + :Input textfield is cleared; +case ( User requests autocomplete) + :BogoBogo suggests a completed command; + :Input textfield is updated; +endswitch + + +stop + +@enduml diff --git a/docs/diagrams/AutocompleteSequenceDiagram.puml b/docs/diagrams/AutocompleteSequenceDiagram.puml new file mode 100644 index 00000000000..03ce698fbef --- /dev/null +++ b/docs/diagrams/AutocompleteSequenceDiagram.puml @@ -0,0 +1,41 @@ +@startuml +!include style.puml + +box UI UI_COLOR_T1 +participant ":CommandBox" as CommandBox UI_COLOR +endbox + +participant ":Logic" as Logic LOGIC_COLOR + +box Model MODEL_COLOR_T1 +participant ":ModelManager" as Model MODEL_COLOR +participant ":Wordbank" as Wordbank MODEL_COLOR +endbox + +activate CommandBox + +CommandBox --> Logic : execute("add noo[tab]") +activate Logic + +Logic --> Model : queryWord("add noo") +activate Model + +Model --> Wordbank : queryWord("add noo") +activate Wordbank + +Wordbank --> Model : "add noodles" +deactivate Wordbank + +Model --> Logic : "add noodles" +deactivate Model + +Logic --> CommandBox : CommandSuggestion\n("add noodles") +deactivate Logic + +CommandBox --> CommandBox : setText("add noodles)" +activate CommandBox + +CommandBox --> CommandBox +deactivate CommandBox + +@enduml diff --git a/docs/diagrams/DeleteSequenceDiagram.puml b/docs/diagrams/DeleteSequenceDiagram.puml index 1dc2311b245..3cf8d1979bd 100644 --- a/docs/diagrams/DeleteSequenceDiagram.puml +++ b/docs/diagrams/DeleteSequenceDiagram.puml @@ -5,7 +5,7 @@ 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 "cmd:DeleteCommand" as DeleteCommand LOGIC_COLOR participant ":CommandResult" as CommandResult LOGIC_COLOR end box @@ -13,10 +13,10 @@ box Model MODEL_COLOR_T1 participant ":Model" as Model MODEL_COLOR end box -[-> LogicManager : execute("delete 1") +[-> LogicManager : execute("delete Milk -c 5") activate LogicManager -LogicManager -> AddressBookParser : parseCommand("delete 1") +LogicManager -> AddressBookParser : parseCommand("delete Milk -c 5") activate AddressBookParser create DeleteCommandParser @@ -26,29 +26,29 @@ activate DeleteCommandParser DeleteCommandParser --> AddressBookParser deactivate DeleteCommandParser -AddressBookParser -> DeleteCommandParser : parse("1") +AddressBookParser -> DeleteCommandParser : parse("Mlik -c 5") activate DeleteCommandParser create DeleteCommand DeleteCommandParser -> DeleteCommand activate DeleteCommand -DeleteCommand --> DeleteCommandParser : d +DeleteCommand --> DeleteCommandParser : cmd deactivate DeleteCommand -DeleteCommandParser --> AddressBookParser : d +DeleteCommandParser --> AddressBookParser : cmd deactivate DeleteCommandParser 'Hidden arrow to position the destroy marker below the end of the activation bar. DeleteCommandParser -[hidden]-> AddressBookParser destroy DeleteCommandParser -AddressBookParser --> LogicManager : d +AddressBookParser --> LogicManager : cmd deactivate AddressBookParser LogicManager -> DeleteCommand : execute() activate DeleteCommand -DeleteCommand -> Model : deletePerson(1) +DeleteCommand -> Model : deleteItem() activate Model Model --> DeleteCommand diff --git a/docs/diagrams/FindSequenceDiagram.puml b/docs/diagrams/FindSequenceDiagram.puml new file mode 100644 index 00000000000..c0daa1a1d8b --- /dev/null +++ b/docs/diagrams/FindSequenceDiagram.puml @@ -0,0 +1,60 @@ +@startuml +!include style.puml + +box Logic LOGIC_COLOR_T1 +participant ":LogicManager" as LogicManager LOGIC_COLOR +participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR +participant ":FindCommandParser" as FindCommandParser LOGIC_COLOR +participant ":FindCommand" as FindCommand LOGIC_COLOR +end box + +box Model MODEL_COLOR_T1 +participant ":Model" as Model MODEL_COLOR +participant ":NameContainsKeywordsPredicate" as NameContainsKeywordsPredicate MODEL_COLOR +end box +[-> LogicManager : execute(sort n/) +activate LogicManager + + +LogicManager -> AddressBookParser : parseCommand(sort n/) +activate AddressBookParser + +create FindCommandParser +AddressBookParser -> FindCommandParser +deactivate FindCommand + +create FindCommand +FindCommandParser -> FindCommand : parse(n/chocolate) +activate FindCommand + +create NameContainsKeywordsPredicate +FindCommandParser -> NameContainsKeywordsPredicate : parse(n/chocolate) +activate NameContainsKeywordsPredicate + +NameContainsKeywordsPredicate --> FindCommand +deactivate NameContainsKeywordsPredicate + +FindCommand --> LogicManager +deactivate FindCommand + +LogicManager -> FindCommand : execute() +activate FindCommand + +FindCommand -> Model : updateFilteredItemList() +activate Model + +Model -> NameContainsKeywordsPredicate : test() +activate NameContainsKeywordsPredicate + +NameContainsKeywordsPredicate --> Model +deactivate NameContainsKeywordsPredicate + +Model --> FindCommand +deactivate Model + +FindCommand --> LogicManager : result +deactivate FindCommand + +[<--LogicManager +deactivate LogicManager +@enduml diff --git a/docs/diagrams/ModelClassDiagram.puml b/docs/diagrams/ModelClassDiagram.puml index 1122257bd9a..083b54d6d4c 100644 --- a/docs/diagrams/ModelClassDiagram.puml +++ b/docs/diagrams/ModelClassDiagram.puml @@ -5,50 +5,44 @@ skinparam arrowColor MODEL_COLOR skinparam classBackgroundColor MODEL_COLOR Package Model <>{ -Interface ReadOnlyAddressBook <> -Interface ReadOnlyUserPrefs <> +Interface ReadOnlyInventory <> Interface Model <> -Class AddressBook -Class ReadOnlyAddressBook +Interface ReadOnlyTransactionList <> +Interface ReadOnlyBookKeeping <> +Interface ReadOnlyUserPrefs <> Class Model Class ModelManager -Class UserPrefs +Class ReadOnlyInventory +Class ReadOnlyTransactionList +Class ReadOnlyBookKeeping Class ReadOnlyUserPrefs - -Class UniquePersonList -Class Person -Class Address -Class Email -Class Name -Class Phone -Class Tag - +Class Inventory +Class TransactionList +Class BookKeeping +Class Order +Class UserPrefs } Class HiddenOutside #FFFFFF HiddenOutside ..> Model -AddressBook .up.|> ReadOnlyAddressBook +Model ..> ReadOnlyBookKeeping +Model ..> ReadOnlyTransactionList +Model ..> ReadOnlyInventory +Model ..> ReadOnlyUserPrefs -ModelManager .up.|> Model -Model .right.> ReadOnlyUserPrefs -Model .left.> ReadOnlyAddressBook -ModelManager -left-> "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 +BookKeeping .up.|> ReadOnlyBookKeeping +Inventory .up.|> ReadOnlyInventory +TransactionList .up.|> ReadOnlyTransactionList +UserPrefs .up.|> ReadOnlyUserPrefs -Name -[hidden]right-> Phone -Phone -[hidden]right-> Address -Address -[hidden]right-> Email +ModelManager .up.|> Model +ModelManager --> "1" BookKeeping +ModelManager --> "1" Inventory +ModelManager --> "1" TransactionList +ModelManager --> "0..1" Order +ModelManager --> "1" UserPrefs -ModelManager -->"~* filtered" Person @enduml diff --git a/docs/diagrams/ModelDisplayableClassDiagram.puml b/docs/diagrams/ModelDisplayableClassDiagram.puml new file mode 100644 index 00000000000..729edc6b04b --- /dev/null +++ b/docs/diagrams/ModelDisplayableClassDiagram.puml @@ -0,0 +1,28 @@ +@startuml +!include style.puml +skinparam arrowThickness 1.1 +skinparam arrowColor MODEL_COLOR +skinparam classBackgroundColor MODEL_COLOR +Package Model <>{ +Interface Model <> +Interface Displayable <> +Class Model +Class Displayable { +{method} asDisplayCard(): UiPart +} + +Class Item +Class TransactionRecord +Class ItemCard +Class TransactionCard +} +Class HiddenOutside #FFFFFF +HiddenOutside ..> Model + +Model ..> Displayable +Item .up.|> Displayable +TransactionRecord .up.|> Displayable + +Item .down.> ItemCard: generates > +TransactionRecord .down.> TransactionCard: generates > +@enduml diff --git a/docs/diagrams/ModelLowLevelClassDiagram.puml b/docs/diagrams/ModelLowLevelClassDiagram.puml new file mode 100644 index 00000000000..02dae9bd6d4 --- /dev/null +++ b/docs/diagrams/ModelLowLevelClassDiagram.puml @@ -0,0 +1,48 @@ +@startuml +!include style.puml +skinparam arrowThickness 1.1 +skinparam arrowColor MODEL_COLOR +skinparam classBackgroundColor MODEL_COLOR + +Package Model <>{ +Interface Model <> +Class Model +Class ModelManager + +Class Inventory +Class TransactionList +Class Order +Class UniqueItemList +Class TransactionRecord { + -id: String + -timestamp: Instant +} +Class Item { + -name: Name + -id: Integer + -salePrice: Double + -costPrice: Double +} + +} + +Class HiddenOutside #FFFFFF +HiddenOutside ..> Model + + +ModelManager .up.|> Model +ModelManager ---> "1" Inventory +ModelManager ---> "1" TransactionList +ModelManager ---> "0..1\nopen\n order" Order +TransactionList o-down-> "*" TransactionRecord + +Inventory .right.> Order + +Order *--> "1" UniqueItemList +Inventory *--> "1" UniqueItemList +TransactionRecord -left-|> Order + +UniqueItemList o-down- "*" Item + + +@enduml diff --git a/docs/diagrams/MutatingInventoryActivityDiagram.puml b/docs/diagrams/MutatingInventoryActivityDiagram.puml new file mode 100644 index 00000000000..73e3dc2c371 --- /dev/null +++ b/docs/diagrams/MutatingInventoryActivityDiagram.puml @@ -0,0 +1,25 @@ +@startuml + +skinparam defaultTextAlignment center + +start +:Add 3 Bananas; +:New Item Object (Banana)\ncreated with count\n 3 in inventory; +:DisplayList is updated; + +switch() +case ( Remove 3 bananas) + :Previous Item\nobject deleted; + :New Item object\ncreated with count 0; +case ( Delete banana) + :Previous Item\nobject deleted; +case ( Edit Banana) + :Previous Item\nobject deleted; + :New Item object\ncreated with new fields; +endswitch + +:DisplayList is updated; + +stop + +@enduml diff --git a/docs/diagrams/ObserverPattern.puml b/docs/diagrams/ObserverPattern.puml new file mode 100644 index 00000000000..8dd662c0b80 --- /dev/null +++ b/docs/diagrams/ObserverPattern.puml @@ -0,0 +1,27 @@ +@startuml +!include style.puml +skinparam arrowThickness 1.1 +skinparam arrowColor MODEL_COLOR +skinparam objectBackgroundColor MODEL_COLOR +Package Model <>{ + +Object "filtered: FilteredList" as filtered +Object "displayed: ObservableList" as displayed +Object "displayList: DisplayList" as displayList +Object "source: ObservableList" as source + +} +Package Ui <>{ +Object "displayListView: ListView" as displayListView +Object "displayListPanel: DisplayListPanel" as displayListPanel +} + +displayListPanel *-up-> displayListView +displayListView -left- filtered: observes > + +displayed -up- filtered: updates > +displayList *-down-> displayed: updates > +displayList *-right-> filtered +displayList o-down- source: observes > + +@enduml diff --git a/docs/diagrams/OldModelClassDiagram.puml b/docs/diagrams/OldModelClassDiagram.puml new file mode 100644 index 00000000000..24666cbdc8d --- /dev/null +++ b/docs/diagrams/OldModelClassDiagram.puml @@ -0,0 +1,69 @@ +@startuml +!include style.puml +skinparam arrowThickness 1.1 +skinparam arrowColor MODEL_COLOR +skinparam classBackgroundColor MODEL_COLOR + +Package Model <>{ +Interface ReadOnlyInventory <> +Interface Model <> +Interface Displayable <> +Interface ReadOnlyTransactionList <> +Interface ReadOnlyBookKeeping <> +Class Model +Class ReadOnlyInventory +Class ReadOnlyTransactionList +Class ReadOnlyBookKeeping +Class Displayable + +Class ModelManager +Class Inventory +Class Order +Class TransactionList + +Class UniqueItemList +Class TransactionRecord +Class ItemCard +Class TransactionCard + +Class Item { + -name: Name + -id: Integer + -salePrice: Double + -costPrice: Double +} +} + +Class HiddenOutside #FFFFFF +HiddenOutside ..> Model + +Model .down.> Displayable +Model .left.> ReadOnlyInventory +Model .right.> ReadOnlyTransactionList + +ModelManager .up.|> Model +ModelManager -left-> "1" Inventory +ModelManager -right-> "0..1" Order +ModelManager -down-> "1" TransactionList + +Inventory .right.> Order +Inventory .up.|> ReadOnlyInventory + +Order *--> "1" UniqueItemList +Inventory *--> "1" UniqueItemList + +UniqueItemList -right-> "~* all" Item + +Item .up.|> Displayable +TransactionRecord -[hidden]left-> Item +TransactionRecord .up.|> Displayable + +TransactionRecord .up.|> Order +Item .up.|> Order + +Item .down.> ItemCard +TransactionRecord .down.> TransactionCard + +TransactionList .up.|> ReadOnlyTransactionList + +@enduml diff --git a/docs/diagrams/OrderFinalState.puml b/docs/diagrams/OrderFinalState.puml new file mode 100644 index 00000000000..01e5ebe9411 --- /dev/null +++ b/docs/diagrams/OrderFinalState.puml @@ -0,0 +1,32 @@ +@startuml +!include style.puml +skinparam ClassFontColor #000000 +skinparam ClassBorderColor #000000 + +title iorder state 2 + +Class modelManager as "__modelManager:ModelManager__" + +Class optionalOrder as "__optionalOrder:OptionalOrder__" + +Class trans2 as "__transactionRecord2:TransactionRecord__" +Class item1 as "__banana:Item__" +Class item2 as "__strawberry:Item__" +item2 -up-> trans2 +item1 -up-> trans2 + +Class transactions as "__transactions:List__" + +Class trans1 as "__transactionRecord1:TransactionRecord__" +Class item1Trans1 as "__pencil:Item__" +Class item2Trans2 as "__pen:Item__" +item2Trans2 -up-> trans1 +item1Trans1 -up-> trans1 + + +transactions -up-> modelManager +trans1 -up-> transactions +trans2 -up-> transactions +optionalOrder -up-> modelManager + +@end diff --git a/docs/diagrams/OrderInitialState.puml b/docs/diagrams/OrderInitialState.puml new file mode 100644 index 00000000000..34fb549103b --- /dev/null +++ b/docs/diagrams/OrderInitialState.puml @@ -0,0 +1,25 @@ +@startuml +!include style.puml +skinparam ClassFontColor #000000 +skinparam ClassBorderColor #000000 + +title Initial state + +Class modelManager as "__modelManager:ModelManager__" + +Class optionalOrder as "__optionalOrder:OptionalOrder__" + +Class transactions as "__transactions:List__" + +Class trans1 as "__transactionRecord1:TransactionRecord__" +Class item1Trans1 as "__pencil:Item__" +Class item2Trans2 as "__pen:Item__" +item2Trans2 -up-> trans1 +item1Trans1 -up-> trans1 + + +transactions -up-> modelManager +optionalOrder -up-> modelManager +trans1 -up-> transactions + +@end diff --git a/docs/diagrams/OrderItem1State.puml b/docs/diagrams/OrderItem1State.puml new file mode 100644 index 00000000000..b81f7aa244f --- /dev/null +++ b/docs/diagrams/OrderItem1State.puml @@ -0,0 +1,28 @@ +@startuml +!include style.puml +skinparam ClassFontColor #000000 +skinparam ClassBorderColor #000000 + +title iorder state 1 + +Class modelManager as "__modelManager:ModelManager__" + +Class optionalOrder as "__optionalOrder:OptionalOrder__" +Class ord as "__order:Order__" +Class item1 as "__banana:Item__" + +Class transactions as "__transactions:List__" + +Class trans1 as "__transactionRecord1:TransactionRecord__" +Class item1Trans1 as "__pencil:Item__" +Class item2Trans2 as "__pen:Item__" +item2Trans2 -up-> trans1 +item1Trans1 -up-> trans1 + +transactions -up-> modelManager +trans1 -up-> transactions +item1 -up-> ord +ord -up-> optionalOrder +optionalOrder -up-> modelManager + +@end diff --git a/docs/diagrams/OrderItem2State.puml b/docs/diagrams/OrderItem2State.puml new file mode 100644 index 00000000000..b9e9ef92a2a --- /dev/null +++ b/docs/diagrams/OrderItem2State.puml @@ -0,0 +1,32 @@ +@startuml +!include style.puml +skinparam ClassFontColor #000000 +skinparam ClassBorderColor #000000 + +title iorder state 2 + +Class modelManager as "__modelManager:ModelManager__" + +Class optionalOrder as "__optionalOrder:OptionalOrder__" + +Class ord as "__order:Order__" +Class item1 as "__banana:Item__" +Class item2 as "__strawberry:Item__" +item2 -up-> ord +item1 -up-> ord + +Class transactions as "__transactions:List__" + +Class trans1 as "__transactionRecord1:TransactionRecord__" +Class item1Trans1 as "__pencil:Item__" +Class item2Trans2 as "__pen:Item__" +item2Trans2 -up-> trans1 +item1Trans1 -up-> trans1 + + +transactions -up-> modelManager +trans1 -up-> transactions +ord -up-> optionalOrder +optionalOrder -up-> modelManager + +@end diff --git a/docs/diagrams/OrderSorderState.puml b/docs/diagrams/OrderSorderState.puml new file mode 100644 index 00000000000..a7db11b1bb0 --- /dev/null +++ b/docs/diagrams/OrderSorderState.puml @@ -0,0 +1,28 @@ +@startuml +!include style.puml +skinparam ClassFontColor #000000 +skinparam ClassBorderColor #000000 + +title sorder state + +Class modelManager as "__modelManager:ModelManager__" + +Class optionalOrder as "__optionalOrder:OptionalOrder__" + +Class ord as "__order:Order__" + +Class transactions as "__transactions:List__" + +Class trans1 as "__transactionRecord1:TransactionRecord__" +Class item1Trans1 as "__pencil:Item__" +Class item2Trans2 as "__pen:Item__" +item2Trans2 -up-> trans1 +item1Trans1 -up-> trans1 + + +transactions -up-> modelManager +trans1 -up-> transactions +ord -up-> optionalOrder +optionalOrder -up-> modelManager + +@end diff --git a/docs/diagrams/SortSequenceDiagram.puml b/docs/diagrams/SortSequenceDiagram.puml new file mode 100644 index 00000000000..6468ec2f5e0 --- /dev/null +++ b/docs/diagrams/SortSequenceDiagram.puml @@ -0,0 +1,54 @@ +@startuml +!include style.puml + +box Logic LOGIC_COLOR_T1 +participant ":LogicManager" as LogicManager LOGIC_COLOR +participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR +participant ":SortCommandParser" as SortCommandParser LOGIC_COLOR +participant ":SortCommand" as SortCommand LOGIC_COLOR +end box + +box Model MODEL_COLOR_T1 +participant ":Model" as Model MODEL_COLOR +participant ":ItemNameComparator" as ItemNameComparator MODEL_COLOR +end box +[-> LogicManager : execute(find n/chocolate) +activate LogicManager + + +LogicManager -> AddressBookParser : parseCommand(find n/chocolate) +activate AddressBookParser + +create SortCommandParser +AddressBookParser -> SortCommandParser +activate SortCommandParser + +create SortCommand +SortCommandParser -> SortCommand : parse(n/) +activate SortCommand + +SortCommand --> LogicManager +deactivate SortCommand + +LogicManager -> SortCommand : execute() +activate SortCommand + +create ItemNameComparator +LogicManager -> ItemNameComparator : execute() +activate ItemNameComparator + +SortCommand -> Model : SortItems() +activate Model + +ItemNameComparator --> Model +deactivate ItemNameComparator + +Model --> SortCommand +deactivate Model + +SortCommand --> LogicManager : result +deactivate SortCommand + +[<--LogicManager +deactivate LogicManager +@enduml diff --git a/docs/diagrams/StorageClassDiagram.puml b/docs/diagrams/StorageClassDiagram.puml index 85ac3ea2dee..1a337a95216 100644 --- a/docs/diagrams/StorageClassDiagram.puml +++ b/docs/diagrams/StorageClassDiagram.puml @@ -6,38 +6,66 @@ skinparam classBackgroundColor STORAGE_COLOR package Storage{ -package "UserPrefs Storage" #F4F6F6{ -Interface UserPrefsStorage <> -Class JsonUserPrefsStorage +package "BookKeeping Storage" #F4F6F6{ +Interface BookKeepingStorage <> +Class JsonBookKeepingStorage +Class JsonSerializableBookKeeping } Interface Storage <> Class StorageManager -package "AddressBook Storage" #F4F6F6{ -Interface AddressBookStorage <> -Class JsonAddressBookStorage -Class JsonSerializableAddressBook -Class JsonAdaptedPerson +package "Inventory Storage" #F4F6F6{ +Interface InventoryStorage <> +Class JsonInventoryStorage +Class JsonSerializableInventory +Class JsonAdaptedItem Class JsonAdaptedTag } +package "Transaction Storage" #F4F6F6{ +Interface TransactionStorage <> +Class JsonTransactionStorage +Class JsonSerializableTransactionList +Class JsonAdaptedOrder +Class JsonAdaptedItemOrder +} + +package "UserPrefs Storage" #F4F6F6{ +Interface UserPrefsStorage <> +Class UserPrefsStorage +Class JsonUserPrefsStorage +} + } Class HiddenOutside #FFFFFF HiddenOutside ..> Storage StorageManager .up.|> Storage +StorageManager -up-> "1" BookKeepingStorage +StorageManager -up-> "1" InventoryStorage +StorageManager -up-> "1" TransactionStorage StorageManager -up-> "1" UserPrefsStorage -StorageManager -up-> "1" AddressBookStorage -Storage -left-|> UserPrefsStorage -Storage -right-|> AddressBookStorage +Storage --|> BookKeepingStorage +Storage --|> InventoryStorage +Storage --|> TransactionStorage +Storage --|> UserPrefsStorage + +JsonBookKeepingStorage .up.|> BookKeepingStorage +JsonBookKeepingStorage .down.> JsonSerializableBookKeeping + +JsonInventoryStorage .up.|> InventoryStorage +JsonInventoryStorage ..> JsonSerializableInventory +JsonSerializableInventory --> "*" JsonAdaptedItem +JsonAdaptedItem --> "*" JsonAdaptedTag + +JsonTransactionStorage .up.|> TransactionStorage +JsonTransactionStorage ..> JsonSerializableTransactionList +JsonSerializableTransactionList --> "*" JsonAdaptedOrder +JsonAdaptedOrder --> "*" JsonAdaptedItemOrder JsonUserPrefsStorage .up.|> UserPrefsStorage -JsonAddressBookStorage .up.|> AddressBookStorage -JsonAddressBookStorage ..> JsonSerializableAddressBook -JsonSerializableAddressBook --> "*" JsonAdaptedPerson -JsonAdaptedPerson --> "*" JsonAdaptedTag @enduml diff --git a/docs/diagrams/TransactOrderSequenceDiagram.puml b/docs/diagrams/TransactOrderSequenceDiagram.puml new file mode 100644 index 00000000000..5d5125b4880 --- /dev/null +++ b/docs/diagrams/TransactOrderSequenceDiagram.puml @@ -0,0 +1,37 @@ +@startuml +!include style.puml + + +Participant ":LogicManager" as logic LOGIC_COLOR +Participant ":StorageManager" as storage STORAGE_COLOR +Participant ":JsonInventoryStorage" as inventoryStorage STORAGE_COLOR_T2 +Participant ":JsonTransactionStorage" as transactionStorage STORAGE_COLOR_T2 +Participant ":JsonBookKeepingStorage" as bookKeepingStorage STORAGE_COLOR_T2 + +-> logic :execute() +activate logic LOGIC_COLOR + +logic -[LOGIC_COLOR]> storage : saveInventory() +activate storage STORAGE_COLOR + +storage -[STORAGE_COLOR]> inventoryStorage : Save to inventory.json +activate inventoryStorage STORAGE_COLOR_T2 +inventoryStorage --[STORAGE_COLOR]> storage +deactivate inventoryStorage + +storage -[STORAGE_COLOR]> transactionStorage : Save to transactions.json +activate transactionStorage STORAGE_COLOR_T2 +transactionStorage --[STORAGE_COLOR]> storage +deactivate transactionStorage + +storage -[STORAGE_COLOR]> bookKeepingStorage : Save to bookKeeping.json +activate bookKeepingStorage STORAGE_COLOR_T2 +bookKeepingStorage --[STORAGE_COLOR]> storage +deactivate bookKeepingStorage + +storage --[STORAGE_COLOR]> logic +deactivate storage + +<-- logic +deactivate logic +@enduml diff --git a/docs/diagrams/UiClassDiagram.puml b/docs/diagrams/UiClassDiagram.puml index ecae4876432..7bbef191558 100644 --- a/docs/diagrams/UiClassDiagram.puml +++ b/docs/diagrams/UiClassDiagram.puml @@ -11,8 +11,7 @@ Class UiManager Class MainWindow Class HelpWindow Class ResultDisplay -Class PersonListPanel -Class PersonCard +Class DisplayListPanel Class StatusBarFooter Class CommandBox } @@ -32,26 +31,23 @@ UiManager .left.|> Ui UiManager -down-> "1" MainWindow MainWindow *-down-> "1" CommandBox MainWindow *-down-> "1" ResultDisplay -MainWindow *-down-> "1" PersonListPanel +MainWindow *-down-> "1" DisplayListPanel MainWindow *-down-> "1" StatusBarFooter MainWindow --> "0..1" HelpWindow -PersonListPanel -down-> "*" PersonCard - MainWindow -left-|> UiPart ResultDisplay --|> UiPart CommandBox --|> UiPart -PersonListPanel --|> UiPart -PersonCard --|> UiPart +DisplayListPanel --|> UiPart StatusBarFooter --|> UiPart HelpWindow --|> UiPart -PersonCard ..> Model +DisplayListPanel ..> Model UiManager -right-> Logic MainWindow -left-> Logic -PersonListPanel -[hidden]left- HelpWindow +DisplayListPanel -[hidden]left- HelpWindow HelpWindow -[hidden]left- CommandBox CommandBox -[hidden]left- ResultDisplay ResultDisplay -[hidden]left- StatusBarFooter diff --git a/docs/diagrams/WordbankUML.puml b/docs/diagrams/WordbankUML.puml new file mode 100644 index 00000000000..268cea635c9 --- /dev/null +++ b/docs/diagrams/WordbankUML.puml @@ -0,0 +1,32 @@ +@startuml +!include style.puml +skinparam arrowThickness 1.1 +skinparam arrowColor MODEL_COLOR +skinparam classBackgroundColor MODEL_COLOR + +Package Logic <> LOGIC_COLOR_T1 { +Abstract Class Command LOGIC_COLOR +Class CompleteCommand LOGIC_COLOR +} + +Package Model <> MODEL_COLOR_T1 { +Class ModelManager +Class WordBank{ ++ queryWord() : String ++ addWord() : void ++ removeWord() : void +} + +Class WordTrie { +} + +} + +CompleteCommand -|> Command LOGIC_COLOR +CompleteCommand --> ModelManager LOGIC_COLOR : queries > + +ModelManager *--> "1" WordBank : queries / updates > +WordBank *--> "2" WordTrie : queries / updates > +note on link: 1 trie for command keywords\n1 trie for item names + +@enduml diff --git a/docs/diagrams/style.puml b/docs/diagrams/style.puml index fad8b0adeaa..ac981bbfbc9 100644 --- a/docs/diagrams/style.puml +++ b/docs/diagrams/style.puml @@ -37,6 +37,8 @@ skinparam BackgroundColor #FFFFFFF skinparam Shadowing false +skinparam classAttributeIconSize 0 + skinparam Class { FontColor #FFFFFF BorderThickness 1 @@ -45,6 +47,18 @@ skinparam Class { FontName Arial } +skinparam Object { + FontColor #FFFFFF + BorderThickness 1 + BorderColor #FFFFFF + StereotypeFontColor #FFFFFF + FontName Arial +} + +skinparam classAttributeFontColor #FFFFFF + +skinparam methods #FFFFFF + skinparam Actor { BorderColor USER_COLOR Color USER_COLOR @@ -71,5 +85,6 @@ skinparam DefaultTextAlignment center skinparam packageStyle Rectangle hide footbox -hide members +hide empty methods +hide empty attributes hide circle diff --git a/docs/images/AddSequenceDiagram.png b/docs/images/AddSequenceDiagram.png new file mode 100644 index 00000000000..079343e470e Binary files /dev/null and b/docs/images/AddSequenceDiagram.png differ diff --git a/docs/images/ArchitectureSequenceDiagram.png b/docs/images/ArchitectureSequenceDiagram.png index 2f1346869d0..88eb2401a35 100644 Binary files a/docs/images/ArchitectureSequenceDiagram.png and b/docs/images/ArchitectureSequenceDiagram.png differ diff --git a/docs/images/AutocompleteActivityDiagram.png b/docs/images/AutocompleteActivityDiagram.png new file mode 100644 index 00000000000..96f5ab4e3c3 Binary files /dev/null and b/docs/images/AutocompleteActivityDiagram.png differ diff --git a/docs/images/AutocompleteSequenceDiagram.png b/docs/images/AutocompleteSequenceDiagram.png new file mode 100644 index 00000000000..e7d45b8085e Binary files /dev/null and b/docs/images/AutocompleteSequenceDiagram.png differ diff --git a/docs/images/DeleteSequenceDiagram.png b/docs/images/DeleteSequenceDiagram.png index fa327b39618..0c586f5719b 100644 Binary files a/docs/images/DeleteSequenceDiagram.png and b/docs/images/DeleteSequenceDiagram.png differ diff --git a/docs/images/FindSequenceDiagram.png b/docs/images/FindSequenceDiagram.png new file mode 100644 index 00000000000..96d9e806a7e Binary files /dev/null and b/docs/images/FindSequenceDiagram.png differ diff --git a/docs/images/ModelClassDiagram.png b/docs/images/ModelClassDiagram.png index 39d7aec4b33..8d8ffa6801b 100644 Binary files a/docs/images/ModelClassDiagram.png and b/docs/images/ModelClassDiagram.png differ diff --git a/docs/images/ModelDisplayableClassDiagram.png b/docs/images/ModelDisplayableClassDiagram.png new file mode 100644 index 00000000000..792b90140cc Binary files /dev/null and b/docs/images/ModelDisplayableClassDiagram.png differ diff --git a/docs/images/ModelLowLevelClassDiagram.png b/docs/images/ModelLowLevelClassDiagram.png new file mode 100644 index 00000000000..31d742b67c0 Binary files /dev/null and b/docs/images/ModelLowLevelClassDiagram.png differ diff --git a/docs/images/MutatingInventoryActivityDiagram.png b/docs/images/MutatingInventoryActivityDiagram.png new file mode 100644 index 00000000000..f75cef5710a Binary files /dev/null and b/docs/images/MutatingInventoryActivityDiagram.png differ diff --git a/docs/images/ObserverPattern.png b/docs/images/ObserverPattern.png new file mode 100644 index 00000000000..a6c98b68f57 Binary files /dev/null and b/docs/images/ObserverPattern.png differ diff --git a/docs/images/OrderFinalState.png b/docs/images/OrderFinalState.png new file mode 100644 index 00000000000..9cfd5dddab0 Binary files /dev/null and b/docs/images/OrderFinalState.png differ diff --git a/docs/images/OrderInitialState.png b/docs/images/OrderInitialState.png new file mode 100644 index 00000000000..21875b2d7a8 Binary files /dev/null and b/docs/images/OrderInitialState.png differ diff --git a/docs/images/OrderItem1State.png b/docs/images/OrderItem1State.png new file mode 100644 index 00000000000..617214f940a Binary files /dev/null and b/docs/images/OrderItem1State.png differ diff --git a/docs/images/OrderItem2State.png b/docs/images/OrderItem2State.png new file mode 100644 index 00000000000..46d08fc40ca Binary files /dev/null and b/docs/images/OrderItem2State.png differ diff --git a/docs/images/OrderSorderState.png b/docs/images/OrderSorderState.png new file mode 100644 index 00000000000..1c75552e404 Binary files /dev/null and b/docs/images/OrderSorderState.png differ diff --git a/docs/images/SortSequenceDiagram.png b/docs/images/SortSequenceDiagram.png new file mode 100644 index 00000000000..8d69bc9ddf4 Binary files /dev/null and b/docs/images/SortSequenceDiagram.png differ diff --git a/docs/images/StorageClassDiagram.png b/docs/images/StorageClassDiagram.png index 82c66f8f16e..4b6e08d7f25 100644 Binary files a/docs/images/StorageClassDiagram.png and b/docs/images/StorageClassDiagram.png differ diff --git a/docs/images/TransactOrderSequenceDiagram.png b/docs/images/TransactOrderSequenceDiagram.png new file mode 100644 index 00000000000..028c9d366f6 Binary files /dev/null and b/docs/images/TransactOrderSequenceDiagram.png differ diff --git a/docs/images/Ui.png b/docs/images/Ui.png index 91488fd1a0f..5663ecc019a 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 4bb8b2ce591..5029eed30f1 100644 Binary files a/docs/images/UiClassDiagram.png and b/docs/images/UiClassDiagram.png differ diff --git a/docs/images/WordbankUML.png b/docs/images/WordbankUML.png new file mode 100644 index 00000000000..5ab31e7a307 Binary files /dev/null and b/docs/images/WordbankUML.png differ diff --git a/docs/images/bernarduskrishna.png b/docs/images/bernarduskrishna.png new file mode 100644 index 00000000000..d4c1c894fc1 Binary files /dev/null and b/docs/images/bernarduskrishna.png differ diff --git a/docs/images/bryanwee023.png b/docs/images/bryanwee023.png new file mode 100644 index 00000000000..43cd69bb332 Binary files /dev/null and b/docs/images/bryanwee023.png differ diff --git a/docs/images/gracewang2322.png b/docs/images/gracewang2322.png new file mode 100644 index 00000000000..80c2fabb76b Binary files /dev/null and b/docs/images/gracewang2322.png differ diff --git a/docs/images/helpMessage.png b/docs/images/helpMessage.png index b1f70470137..8734f339fc4 100644 Binary files a/docs/images/helpMessage.png and b/docs/images/helpMessage.png differ diff --git a/docs/images/manageOrdersWorkflow.png b/docs/images/manageOrdersWorkflow.png new file mode 100644 index 00000000000..12caf268eb6 Binary files /dev/null and b/docs/images/manageOrdersWorkflow.png differ diff --git a/docs/images/screenshots/add_item.png b/docs/images/screenshots/add_item.png new file mode 100644 index 00000000000..c2869afa2d0 Binary files /dev/null and b/docs/images/screenshots/add_item.png differ diff --git a/docs/images/screenshots/clear.png b/docs/images/screenshots/clear.png new file mode 100644 index 00000000000..3eff2f8efad Binary files /dev/null and b/docs/images/screenshots/clear.png differ diff --git a/docs/images/screenshots/corder.png b/docs/images/screenshots/corder.png new file mode 100644 index 00000000000..f273e2e2d01 Binary files /dev/null and b/docs/images/screenshots/corder.png differ diff --git a/docs/images/screenshots/delete_item.png b/docs/images/screenshots/delete_item.png new file mode 100644 index 00000000000..ace7096d051 Binary files /dev/null and b/docs/images/screenshots/delete_item.png differ diff --git a/docs/images/screenshots/edit_item.png b/docs/images/screenshots/edit_item.png new file mode 100644 index 00000000000..9fe90d21fa0 Binary files /dev/null and b/docs/images/screenshots/edit_item.png differ diff --git a/docs/images/screenshots/eorder.png b/docs/images/screenshots/eorder.png new file mode 100644 index 00000000000..4811623abd6 Binary files /dev/null and b/docs/images/screenshots/eorder.png differ diff --git a/docs/images/screenshots/find_item.png b/docs/images/screenshots/find_item.png new file mode 100644 index 00000000000..0a58c4a4868 Binary files /dev/null and b/docs/images/screenshots/find_item.png differ diff --git a/docs/images/screenshots/iorder.png b/docs/images/screenshots/iorder.png new file mode 100644 index 00000000000..740f84bc300 Binary files /dev/null and b/docs/images/screenshots/iorder.png differ diff --git a/docs/images/screenshots/list_items.png b/docs/images/screenshots/list_items.png new file mode 100644 index 00000000000..c29d37d5960 Binary files /dev/null and b/docs/images/screenshots/list_items.png differ diff --git a/docs/images/screenshots/remove_item.png b/docs/images/screenshots/remove_item.png new file mode 100644 index 00000000000..3da8ab558b8 Binary files /dev/null and b/docs/images/screenshots/remove_item.png differ diff --git a/docs/images/screenshots/sorder.png b/docs/images/screenshots/sorder.png new file mode 100644 index 00000000000..85899314e39 Binary files /dev/null and b/docs/images/screenshots/sorder.png differ diff --git a/docs/images/screenshots/sort_items.png b/docs/images/screenshots/sort_items.png new file mode 100644 index 00000000000..46aa0d9d521 Binary files /dev/null and b/docs/images/screenshots/sort_items.png differ diff --git a/docs/images/wangpeialex.png b/docs/images/wangpeialex.png new file mode 100644 index 00000000000..87dd249944e Binary files /dev/null and b/docs/images/wangpeialex.png differ diff --git a/docs/index.md b/docs/index.md index 7601dbaad0d..c5387692136 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,6 +1,7 @@ --- layout: page -title: AddressBook Level-3 +title: Home +nav_order: 1 --- [![CI Status](https://github.com/se-edu/addressbook-level3/workflows/Java%20CI/badge.svg)](https://github.com/se-edu/addressbook-level3/actions) @@ -8,12 +9,14 @@ title: AddressBook Level-3 ![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). +**BogoBogo is a desktop application for small business owners to manage their inventories.** 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 BogoBogo, head over to the [_Quick Start_ section of the **User Guide**](UserGuide.html#quick-start). +* If you are interested about developing BogoBogo, the [**Developer Guide**](DeveloperGuide.html) is a good place to start. **Acknowledgements** +* BogoBogo is forked from [Addressbook Level 3](https://se-education.org/addressbook-level3/) * Libraries used: [JavaFX](https://openjfx.io/), [Jackson](https://github.com/FasterXML/jackson), [JUnit5](https://github.com/junit-team/junit5) +* Theme used: [just-the-docs](https://github.com/pmarsceill/just-the-docs) diff --git a/docs/team/TheTeam.md b/docs/team/TheTeam.md new file mode 100644 index 00000000000..5aa44e9a0d8 --- /dev/null +++ b/docs/team/TheTeam.md @@ -0,0 +1,9 @@ +--- +layout: default +title: The Team +nav_order: 4 +has_children: true +--- + +# The team +{: .no_toc } diff --git a/docs/team/bernarduskrishna.md b/docs/team/bernarduskrishna.md new file mode 100644 index 00000000000..74fc710775a --- /dev/null +++ b/docs/team/bernarduskrishna.md @@ -0,0 +1,50 @@ +--- +layout: page +title: Bernard's Project Portfolio Page +parent: The Team +--- + +### Project: BogoBogo + +BogoBogo is a desktop inventory management application developed for small business owners. 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**: Introduction of count field + replenish function + optional flags. Link to PR: [\#24](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/24) [\#42](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/42) + * What it does: While the original `add` command only allowed addition of new items, now if `add` is used on existing item on inventory, it will replenish the item according to the count instead. When replenishing, only either name or id is a mandatory flag, rest is optional (count is assumed to be 1 if empty). + * Justification: Unlike `Person` in AB3, an `Item` has a count field which indicates the stock of the `Item`. Thus, adding an existing item should replenish the item rather than throwing an error. The usage of optional fields is to bring convenience to the businessowner as providing all details correctly goes against the efficiency of CLI app. + * Highlights: This requires quite a major change from the AB3 implementation, as AB3 did not support optional flags. + +* **New Feature**: Introduction of Cost Price and Sales Price fields. Link to PR: [\#65](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/65) + * What it does: Allows user to store cost price and sales price of each Item. Cost price is the price at which the business owner bought the item while sales price is the price at which the business owner sells the item. The flags for each are `/cp` and `/sp`. + * Justification: It will eventually be used for bookkeeping purposes. + +* **New Feature**: Save Transactions and BookKeeping as persistent data (json). Link to PR: [\#92](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/92) [\#95](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/95) + * What it does: Previously, transaction data are only stored within a session (i.e. once the user exits the app, the data won't be there anymore). Now, all transaction data are stored inside a json file. Furthermore, to facilitate financial bookkeeping purposes, total costs, total revenue, and total profit are stored in bookkeeping.json as well. Both BookKeeping and Transactions data can be found by typing `list txns` + * Justification: It's to allow the app to be useful for more than 1 session, which clearly has to be the case. + * Highlights: I honestly struggled with understanding the design of the storage class at the start, thus the initial PR worked, but does not follow the existing dessign pattern closely. Upon further trials, the fixed code with correct design is given in this PR [\#161](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/161). + +* **Testing**: + * I was in charge of jacking up the testing coverage for all existing classes overall. The following PRs show the testing code I did to increase Codecov testing coverage [\#185](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/185), [\#201](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/201), [\#204](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/204). As a result, our team's [Codecov](https://app.codecov.io/gh/AY2122S1-CS2103-F10-2/tp/) coverage increased from 74.00% to 80.16%. + * Did internal testing of BogoBogo. Sample issue: [\#182](https://github.com/AY2122S1-CS2103-F10-2/tp/issues/182). + * Fix bugs found from internal testing: [\#185](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/185), [\#172](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/172), [\#109](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/109), [\#98](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/98) + +* **Code contributed**: [RepoSense link](https://nus-cs2103-ay2122s1.github.io/tp-dashboard/?search=&sort=groupTitle&sortWithin=title&timeframe=commit&mergegroup=&groupSelect=groupByRepos&breakdown=true&checkedFileTypes=docs~functional-code~test-code~other&since=2021-09-17&tabOpen=true&tabType=authorship&tabAuthor=bernarduskrishna&tabRepo=AY2122S1-CS2103-F10-2%2Ftp%5Bmaster%5D&authorshipIsMergeGroup=false&authorshipFileTypes=docs~functional-code~test-code~other&authorshipIsBinaryFileTypeChecked=false) + +* **Documentation**: + * User Guide + * Revise the UG partially for v1.3 and Mock PE [\#101](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/101/files) + * Include screenshots for the UG [\#105](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/105) + * Developer Guide + * Wrote the implementation details of `Ordering` and drew the required UMLs [\#161](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/161/files) + * Helped a team member with the implementation details of `Mutating Inventory` and drew the required UMLs [\#185](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/185/files) + * Wrote part of use cases [\#73](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/73) + * Proofread the final version of UG and DG. Links to PR: [\#215](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/215), [\#216](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/216), [\#217](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/217), [\#218](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/218) + +* **Community**: + * Team-based Tasks: + * Wrote most of the issues during meetings. [Issues](https://github.com/AY2122S1-CS2103-F10-2/tp/issues?q=is%3Aclosed+is%3Aissue+author%3Abernarduskrishna+) + * Wrote AboutUs Page. [AboutUs](https://ay2122s1-cs2103-f10-2.github.io/tp/AboutUs.html) + * PR Reviews: [\#27](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/27), [\#37](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/37), [\#52](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/52), [\#93](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/93), [\#192](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/192) + * Reported bugs and suggestions for other teams during PE-D ([PE-D](https://github.com/bernarduskrishna/ped/issues)) diff --git a/docs/team/bryanwee023.md b/docs/team/bryanwee023.md new file mode 100644 index 00000000000..ea89cfb5e94 --- /dev/null +++ b/docs/team/bryanwee023.md @@ -0,0 +1,71 @@ +--- +layout: page +title: Bryan's Project Portfolio Page +parent: The Team +--- + +### Project: BogoBogo + +BogoBogo is a desktop inventory management application developed for small business owners. 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**: Listing transactions, a particular transaction, or the current order. + * What it does: Allows BogoBogo to switch what is displayed on the main display panel upon the user's request (e.g. display transactions). + * Justification: This feature allows commands to indirectly control `ui` without introducing any additional coupling. + * Highlights: This enhancement required a major revamp to AB3's existing observer pattern. + To allow the switching of the observed list (e.g. from inventory items to order items) within `model`, there was a need for a separate class to handle the logic. [More details here](https://ay2122s1-cs2103-f10-2.github.io/tp/DeveloperGuide.html#controlling-the-display-panel-in-ui) + * Links to PRs: [\#96](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/96), [\#100](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/100) + +* **New Feature**: Delete and Remove Commands. + * What it does: Allows the user to either remove an item from the inventory or delete the item data entirely. + * Justification: AB3 only supports deletion. However, business owners might want to remove an unsold item + from the inventory (e.g. expired goods), or delete an incorrectly entered item. Spawning 2 distinct commands from AB3's + original `DeleteCommand` enables this. + * Links to PRs: [\#44](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/44), [\#63](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/63) + +* **Enhancement**: Improve finding of items. + * What it does: Instead of searching for exact word matches, BogoBogo searches for partial word matches. (e.g. "Po" shoul match "Potato" but not "Hippo). + * Justification: Searching by name mirrors the conventional search bars which users are likely used to. Finding would have been very clunky otherwise. + Searching with multiple fields is also now supported, making the search experience feel much more familiar and user-friendly. + * Highlights: This required major refactoring of `FindCommand` and `StringUtil`. Implementing an intuitive search style required algorithmic thinking too. + * Links to PRs: [\#165](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/165) + +* **Enhancement**: Implemented more robust responses by BogoBogo. + * What it does: BogoBogo will respond more appropriately under more niche scenarios. + * Justification: This feature makes BogoBogo much more user-friendly. With robust responses, even a careless user will have a pleasant experience with BogoBogo. + * Highlights: After my teammates have implemented the core components of a feature, I add on by refactoring. Along the way, I have added utility classes such as `ItemDescriptor` and refactored `ArgMultimap` to help me with this. + * Links to PRs: [\#44](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/44), [\#53](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/53). [\#74](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/74), [\#192](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/192) + +* **Testing**: Added and maintain testing for features other than my own: + * Tests for storage component [\#188](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/188) + * Tests for order related commands [\#74](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/74) + +* **Code + contributed**: [RepoSense link](https://nus-cs2103-ay2122s1.github.io/tp-dashboard/?search=&sort=groupTitle&sortWithin=title&timeframe=commit&mergegroup=&groupSelect=groupByRepos&breakdown=true&checkedFileTypes=docs~functional-code~test-code~other&since=2021-09-17&tabOpen=true&tabType=authorship&tabAuthor=bryanwee023&tabRepo=AY2122S1-CS2103-F10-2%2Ftp%5Bmaster%5D&authorshipIsMergeGroup=false&authorshipFileTypes=docs~functional-code~test-code&authorshipIsBinaryFileTypeChecked=false) + +* **Documentation**: + * User Guide: + * Wrote the final version of the UG [\#159](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/159) + * Integrated a new Jekyll theme [\#159](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/159) + * Developer Guide: + * Vetted high-level architectural diagrams + * Wrote the implementation details of `DisplayList` [\#179](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/76) + * Wrote the proposal for an autocomplete feature [\#211](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/211) + * Consolidated and formatted use cases. [\#183](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/183) + * Formatted the Developer's Guide [\#211](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/211) + +* **Community**: + * Generally assisted the team with advice on implementation of features and architectural patterns. + * e.g. Noted the mismatch of abstraction level between `BookKeepingStorage` and `TransactionStorage` in [\#95](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/95). + * Team based tasks: + * Helped with managing and labelling of issues in the issue tracker. + * Set up Github Actions and Jekyll theme in documentation. + * Assisted team with Git issues (e.g. rebasing, forking, etc.) + * PRs reviewed: [\#24](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/24) + , [\#25](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/25) + , [\#43](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/43) + , [\#47](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/47) + , [\#64](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/64) + * Reported bugs and suggestions for other teams during PE-D ([PE-D](https://github.com/bryanwee023/ped/issues)) diff --git a/docs/team/gracewang2322.md b/docs/team/gracewang2322.md new file mode 100644 index 00000000000..327640fce88 --- /dev/null +++ b/docs/team/gracewang2322.md @@ -0,0 +1,90 @@ +--- +layout: page +title: Grace's Project Portfolio Page +parent: The Team +--- + +### Project: BogoBogo + +BogoBogo is a desktop inventory management application developed for small business owners. 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. + +* **Enhancement**: Enhancing logic of Commands to correctly detect existence of items in the inventory. + * What it does: Allows Add, Delete, Remove and order commands to show appropriate error message when the user: + 1. Tries to access items with existing id but nonexistent name, vise versa + 2. Add in extra flags that are unnecessary + * Justification: This feature allows detection of non-existent items whose logic is originally not present in AB3. + * Highlights: This enhancement required a major revamp to AB3's existing command logic. + 1. In AB3, the items are considered present in the current inventory as long as one of the name or id field is present. However, this causes false identification + of items in Bogobogo as there may be a situation where one of the field inputted matches an existing item but other fields does not exist. + 2. Originally, AB3 does not recognise extra flags and treats them as a Parse error for required fields. However, the user might be instead putting new fields that are + extra. Thus, Bogobogo has to detect the extra flags and decide whether to output error or just a warning. + * Links to PRs: [\#103](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/103) + +* **Enhancement**: Adding specific restrictions for different fields in an item. + * What it does: Apply restrictions for user inputs regarding name and id. + * Justification: This feature repurposes the parsing requirements to be customised for Bogobogo. + * Highlights: This enhancement required considerations of all edge cases on user inputs as the restriction on the fields are vastly different from the requirements of AB3. + * Links to PRs: [\#78](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/78), [\#52](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/52), [\#27](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/27) + +* **New Feature**: Find Command + * What it does: Allows the user to find items that matches the id or tag given and allows finding of multiple ids, names and tags as well. + * Justification: AB3 only supports finding by name. However, as an inventory tracker, BogoBogo would need to allow users + * to track by id and tag as well. Users would need to find by id as id provides unique identification of items and tag such as 'popular' would allow + * user to quick find the items that are welcomed by buyers to better make inventory decisions. + * Links to PRs: [\#106](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/106), [\#25](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/25) + +* **New Feature**: Help Command + * What it does: Allows new users to query how to use each command. + * Justification: AB3 only supports generic help message which links the users back to user guide. However, Bogobogo is more user-friendly in allowing + * query of specific commands and displaying each of their message usages. + * Links to PRs: [\#47](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/47), [\#174](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/174) + +* **Testing**: + * System Testing: + * Did internal testing of Bogobogo and fixed bugs on commands found. + * Links to PR: + [\#196](https://github.com/AY2122S1-CS2103-F10-2/tp/issues/196), + [\#180](https://github.com/AY2122S1-CS2103-F10-2/tp/issues/180), + [\#174](https://github.com/AY2122S1-CS2103-F10-2/tp/issues/174), + [\#173](https://github.com/AY2122S1-CS2103-F10-2/tp/issues/173), + [\#103](https://github.com/AY2122S1-CS2103-F10-2/tp/issues/103) + * Acceptance Testing: + * Fix User Guide and Developer Guide inconsistency, ambiguity, and errors. + * Links to PR: + [\#203](https://github.com/AY2122S1-CS2103-F10-2/tp/issues/203), + [\#186](https://github.com/AY2122S1-CS2103-F10-2/tp/issues/186) + +* **Code + contributed**: [RepoSense link](https://nus-cs2103-ay2122s1.github.io/tp-dashboard/?search=gracewang&sort=groupTitle&sortWithin=title&timeframe=commit&mergegroup=&groupSelect=groupByRepos&breakdown=true&checkedFileTypes=docs~functional-code~test-code~other&since=2021-09-17&tabOpen=true&tabType=authorship&tabAuthor=GraceWang2322&tabRepo=AY2122S1-CS2103-F10-2%2Ftp%5Bmaster%5D&authorshipIsMergeGroup=false&authorshipFileTypes=docs~functional-code~test-code&authorshipIsBinaryFileTypeChecked=false) + +* **Documentation**: + * User Guide: + * Updated use cases for Find, Help, Add commands + * Proofread and fix User Guide inconsistency, ambiguity, and errors. + * Links to PR: + [\#203](https://github.com/AY2122S1-CS2103-F10-2/tp/issues/203) + * Developer Guide: + * Add implementation features for Mutating Inventory + [\#164](https://github.com/AY2122S1-CS2103-F10-2/tp/issues/164) + * Add manual testing under appendix + [\#207](https://github.com/AY2122S1-CS2103-F10-2/tp/issues/207) + * Update use cases for commands + [\#181](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/181) + [\#146](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/146) + * Proofread and Fix inconsistency, ambiguity, and errors. + [\#186](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/186) + +* **Community**: +* PRs reviewed: + [\#44](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/44) + [\#50](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/50) + [\#92](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/92) + [\#98](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/98) + [\#100](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/100) + [\#101](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/101) +* Reported bugs and suggestions for other teams during PE-D + ([PE-D](https://github.com/GraceWang2322/ped/issuess)) + 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/wangpeialex.md b/docs/team/wangpeialex.md new file mode 100644 index 00000000000..6e529eded21 --- /dev/null +++ b/docs/team/wangpeialex.md @@ -0,0 +1,81 @@ +--- +layout: page +title: Wang Pei's Project Portfolio Page +parent: The Team +--- + +### Project: BogoBogo + +BogoBogo is a desktop inventory management application developed for small business owners. 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**: Implemented the core components to enable placing orders. + * What it does: allows the user to order items, add and remove items from order, and place the order to make a + transaction. + * Justification: This feature improves the product significantly because a user can not only log items in inventory + but also monitor business dynamics via the order system. + * Highlights: This enhancement affects existing model structures and new features to be added in the future. It + required an in-depth analysis of design alternatives. The implementation too was challenging as it required + changes to multiple existing components while designing good interacting logic and abstraction between them. + +* **New Feature**: Added transaction history. + * What it does: allows the user to check past transactions made via order system and calculates essential historical + business statistics. + * Justification: This feature improves the product significantly because a user can track transaction histories to + better retrospect and manage business. + * Highlights: This enhancement is added on top of the order system implemented in last feature to extend and make + the order system interaction more complete and powerful. + +* **Functional Code**: Added commands to enable order related operations. + * Implemented `sorder`, `iorder`, `corder`, and `eorder` commands and their parsers. + * What it does: allows the `Ui` component to parse user commands of order operations and activates the `Model` + and `Storage` components to execute the operations and update the internal states. + + +* **Code + contributed**: [RepoSense link](https://nus-cs2103-ay2122s1.github.io/tp-dashboard/?search=&sort=groupTitle&sortWithin=title&timeframe=commit&mergegroup=&groupSelect=groupByRepos&breakdown=true&checkedFileTypes=docs~functional-code~test-code~other&since=2021-09-17&tabOpen=true&tabType=authorship&tabAuthor=wangpeialex&tabRepo=AY2122S1-CS2103-F10-2%2Ftp%5Bmaster%5D&authorshipIsMergeGroup=false&authorshipFileTypes=docs~functional-code~test-code&authorshipIsBinaryFileTypeChecked=false) + +* **Enhancements to existing features**: + * Wrote additional tests for existing features to increase coverage. (Pull requests [\#82](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/82) + , [\#190](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/190)) + +* **Documentation**: + * User Guide: + * Drafted the skeleton of the user guide in v1.1 [\#11](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/11) + * Added existing functionalities and features of v1.3 to user + guide. [\#50](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/50) + * Developer Guide: + * Drafted the skeleton of the developer guide in + v1.3 [\#76](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/76) + * Drew the architecture class diagrams of `Ui`, `Model`, `Storage` + components. [\#93](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/93) + * Added use cases for all commands and features implemented in + v1.3 [\#93](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/93) + * Updated and drew new class diagrams of `Model` components to reflect new design + structure [\#177](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/177) + * Refined and updated class diagrams to make them more and clean and + readable [\#178](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/178/files?authenticity_token=cnwcniV%2B3SlxviaiSsFhbzbBAYOnwhmeY2huI3o3cGoSb8zemdrQDT4cW%2B9c4lGKPdVT4ZxW%2BANMgfyP%2FE269A%3D%3D&file-filters%5B%5D=.png) + * Drew object diagrams for Observer pattern. [\#184](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/184) + * Drafted the Effort appendix. [\#212](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/212) +* **Manual Testing**: + * System Testing: + * Tested all commands with positive and negative EP cases. + * Logged and reported bugs to team for bug fix solutions. + * Acceptance Testing: + * Tested the app against User Guide. + * Fixed User Guide inconsistency, ambiguity, and errors. + * Logged and reported bugs and possible improvements to team for bug fix solutions. ( + [\#197](https://github.com/AY2122S1-CS2103-F10-2/tp/issues/197), + [\#198](https://github.com/AY2122S1-CS2103-F10-2/tp/issues/198), + [\#199](https://github.com/AY2122S1-CS2103-F10-2/tp/issues/199)) + + +* **Community**: + * PRs reviewed: [\#37](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/37) + , [\#38](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/38) + , [\#42](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/42) + , [\#92](https://github.com/AY2122S1-CS2103-F10-2/tp/pull/92) + * Reported bugs and suggestions for other teams in the class ( + examples: [PE-D](https://github.com/wangpeialex/ped/issues)) diff --git a/docs/tutorials/AddRemark.md b/docs/tutorials/AddRemark.md deleted file mode 100644 index 8919d8eaa17..00000000000 --- a/docs/tutorials/AddRemark.md +++ /dev/null @@ -1,401 +0,0 @@ ---- -layout: page -title: "Tutorial: Adding a command" ---- - -Let's walk you through the implementation of a new command — `remark`. - -This command allows users of the AddressBook application to add optional remarks to people in their address book and edit it if required. The command should have the following format: - -`remark INDEX r/REMARK` (e.g., `remark 2 r/Likes baseball`) - -We’ll assume that you have already set up the development environment as outlined in the Developer’s Guide. - - -## Create a new `remark` command - -Looking in the `logic.command` package, you will notice that each existing command have their own class. All the commands inherit from the abstract class `Command` which means that they must override `execute()`. Each `Command` returns an instance of `CommandResult` upon success and `CommandResult#feedbackToUser` is printed to the `ResultDisplay`. - -Let’s start by creating a new `RemarkCommand` class in the `src/main/java/seedu/address/logic/command` directory. - -For now, let’s keep `RemarkCommand` as simple as possible and print some output. We accomplish that by returning a `CommandResult` with an accompanying message. - -**`RemarkCommand.java`:** - -``` java -package seedu.address.logic.commands; - -import seedu.address.model.Model; - -/** - * Changes the remark of an existing person in the address book. - */ -public class RemarkCommand extends Command { - - public static final String COMMAND_WORD = "remark"; - - @Override - public CommandResult execute(Model model) { - return new CommandResult("Hello from remark"); - } -} -``` - -### Hook `RemarkCommand` into the application - -Now that we have our `RemarkCommand` ready to be executed, we need to update `AddressBookParser#parseCommand()` to recognize the `remark` keyword. Add the new command to the `switch` block by creating a new `case` that returns a new instance of `RemarkCommand`. - -You can refer to the changes in this [diff](https://github.com/se-edu/addressbook-level3/commit/35eb7286f18a029d39cb7a29df8f172a001e4fd8#diff-34ace715a8a8d2e5a66e71289f017b47). - -### Run the application - -Run `Main#main` and try out your new `RemarkCommand`. If everything went well, you should see something like this: - -![Output displayed](../images/add-remark/RemarkHello.png) - -## Change `RemarkCommand` to throw an exception - -While we have successfully printed a message to `ResultDisplay`, the command does not do what it is supposed to do. Let’s change the command to throw a `CommandException` to accurately reflect that our command is still a work in progress. - -![The relationship between RemarkCommand and Command](../images/add-remark/CommandInterface.png) - -Following the convention in other commands, we add relevant messages as constants and use them. - -**`RemarkCommand.java`:** - -``` java - public static final String MESSAGE_USAGE = COMMAND_WORD - + ": Edits the remark of the person identified " - + "by the index number used in the last person listing. " - + "Existing remark will be overwritten by the input.\n" - + "Parameters: INDEX (must be a positive integer) " - + "r/ [REMARK]\n" - + "Example: " + COMMAND_WORD + " 1 " - + "r/ Likes to swim."; - - public static final String MESSAGE_NOT_IMPLEMENTED_YET = - "Remark command not implemented yet"; - - @Override - public CommandResult execute(Model model) throws CommandException { - throw new CommandException(MESSAGE_NOT_IMPLEMENTED_YET); - } -``` - -## Enhancing `RemarkCommand` - -Let’s change `RemarkCommand` to parse input from the user. - -### Make the command accept parameters - -We start by modifying the constructor of `RemarkCommand` to accept an `Index` and a `String`. While we are at it, let’s change the error message to echo the values. While this is not a replacement for tests, it is an obvious way to tell if our code is functioning as intended. - -``` java -import static seedu.address.commons.util.CollectionUtil.requireAllNonNull; -//... -public class RemarkCommand extends Command { - //... - public static final String MESSAGE_ARGUMENTS = "Index: %1$d, Remark: %2$s"; - - private final Index index; - private final String remark; - - /** - * @param index of the person in the filtered person list to edit the remark - * @param remark of the person to be updated to - */ - public RemarkCommand(Index index, String remark) { - requireAllNonNull(index, remark); - - this.index = index; - this.remark = remark; - } - @Override - public CommandResult execute(Model model) throws CommandException { - throw new CommandException( - String.format(MESSAGE_ARGUMENTS, index.getOneBased(), remark)); - } - - @Override - public boolean equals(Object other) { - // short circuit if same object - if (other == this) { - return true; - } - - // instanceof handles nulls - if (!(other instanceof RemarkCommand)) { - return false; - } - - // state check - RemarkCommand e = (RemarkCommand) other; - return index.equals(e.index) - && remark.equals(e.remark); - } -} -``` - -Your code should look something like [this](https://github.com/se-edu/addressbook-level3/commit/35eb7286f18a029d39cb7a29df8f172a001e4fd8#diff-34ace715a8a8d2e5a66e71289f017b47) after you are done. - -### Parse user input - -Now let’s move on to writing a parser that will extract the index and remark from the input provided by the user. - -Create a `RemarkCommandParser` class in the `seedu.address.logic.parser` package. The class must extend the `Parser` interface. - -![The relationship between Parser and RemarkCommandParser](../images/add-remark/ParserInterface.png) - -Thankfully, `ArgumentTokenizer#tokenize()` makes it trivial to parse user input. Let’s take a look at the JavaDoc provided for the function to understand what it does. - -**`ArgumentTokenizer.java`:** - -``` java -/** - * Tokenizes an arguments string and returns an {@code ArgumentMultimap} - * object that maps prefixes to their respective argument values. Only the - * given prefixes will be recognized in the arguments string. - * - * @param argsString Arguments string of the form: - * {@code preamble value value ...} - * @param prefixes Prefixes to tokenize the arguments string with - * @return ArgumentMultimap object that maps prefixes to their - * arguments - */ -``` - -We can tell `ArgumentTokenizer#tokenize()` to look out for our new prefix `r/` and it will return us an instance of `ArgumentMultimap`. Now let’s find out what we need to do in order to obtain the Index and String that we need. Let’s look through `ArgumentMultimap` : - -**`ArgumentMultimap.java`:** - -``` java -/** - * Returns the last value of {@code prefix}. - */ -public Optional getValue(Prefix prefix) { - List values = getAllValues(prefix); - return values.isEmpty() ? Optional.empty() : - Optional.of(values.get(values.size() - 1)); -} -``` - -This appears to be what we need to get a String of the remark. But what about the Index? Let's take a quick peek at existing `Command` that uses an index to see how it is done. - -**`DeleteCommandParser.java`:** - -``` java -Index index = ParserUtil.parseIndex(args); -return new DeleteCommand(index); -``` - -There appears to be another utility class that obtains an `Index` from the input provided by the user. - -Now that we have the know-how to extract the data that we need from the user’s input, we can parse the user command and create a new instance of `RemarkCommand`, as given below. - -**`RemarkCommandParser.java`:** - -``` java -public RemarkCommand parse(String args) throws ParseException { - requireNonNull(args); - ArgumentMultimap argMultimap = ArgumentTokenizer.tokenize(args, - PREFIX_REMARK); - - Index index; - try { - index = ParserUtil.parseIndex(argMultimap.getPreamble()); - } catch (IllegalValueException ive) { - throw new ParseException(String.format(MESSAGE_INVALID_COMMAND_FORMAT, - RemarkCommand.MESSAGE_USAGE), ive); - } - - String remark = argMultimap.getValue(PREFIX_REMARK).orElse(""); - - return new RemarkCommand(index, remark); -} -``` - -
- -:information_source: Don’t forget to update `AddressBookParser` to use our new `RemarkCommandParser`! - -
- -If you are stuck, check out the sample -[here](https://github.com/se-edu/addressbook-level3/commit/dc6d5139d08f6403da0ec624ea32bd79a2ae0cbf#diff-fc19ecee89c3732a62fbc8c840250508). - -## Add `Remark` to the model - -Now that we have all the information that we need, let’s lay the groundwork for propagating the remarks added into the in-memory storage of person data. We achieve that by working with the `Person` model. Each field in a Person is implemented as a separate class (e.g. a `Name` object represents the person’s name). That means we should add a `Remark` class so that we can use a `Remark` object to represent a remark given to a person. - -### Add a new `Remark` class - -Create a new `Remark` in `seedu.address.model.person`. Since a `Remark` is a field that is similar to `Address`, we can reuse a significant bit of code. - -A copy-paste and search-replace later, you should have something like [this](https://github.com/se-edu/addressbook-level3/commit/4516e099699baa9e2d51801bd26f016d812dedcc#diff-af2f075d24dfcd333876f0fbce321f25). Note how `Remark` has no constrains and thus does not require input -validation. - -### Make use of `Remark` - -Let’s change `RemarkCommand` and `RemarkCommandParser` to use the new `Remark` class instead of plain `String`. These should be relatively simple changes. - -## Add a placeholder element for remark to the UI - -Without getting too deep into `fxml`, let’s go on a 5 minute adventure to get some placeholder text to show up for each person. - -Simply add the following to [`seedu.address.ui.PersonCard`](https://github.com/se-edu/addressbook-level3/commit/850b78879582f38accb05dd20c245963c65ea599#diff-0c6b6abcfac8c205e075294f25e851fe). - -**`PersonCard.java`:** - -``` java -@FXML -private Label remark; -``` - - -`@FXML` is an annotation that marks a private or protected field and makes it accessible to FXML. It might sound like Greek to you right now, don’t worry — we will get back to it later. - -Then insert the following into [`main/resources/view/PersonListCard.fxml`](https://github.com/se-edu/addressbook-level3/commit/850b78879582f38accb05dd20c245963c65ea599#diff-12580431f55d7880578aa4c16f249e71). - -**`PersonListCard.fxml`:** - -``` xml -