diff --git a/README.md b/README.md index 13f5c77403f..fbf473dc71e 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,22 @@ -[![CI Status](https://github.com/se-edu/addressbook-level3/workflows/Java%20CI/badge.svg)](https://github.com/se-edu/addressbook-level3/actions) +[![CI Status](https://github.com/AY2021S1-CS2103-W14-3/tp/workflows/Java%20CI/badge.svg)](https://github.com/AY2021S1-CS2103-W14-3/tp/actions) +# Introduction to Bamboo +**Bamboo** is a brown-field software engineering team project based on the +[AddressBook Level 3 (AB3)](https://github.com/se-edu/addressbook-level3) architecture, aimed at providing college students with a +simple and accessible solution to **personal finance management**. + +## App Preview ![Ui](docs/images/Ui.png) -* This is **a sample project for Software Engineering (SE) students**.
- Example usages: - * as a starting point of a course project (as opposed to writing everything from scratch) - * as a case study -* The project simulates an ongoing software project for a desktop application (called _AddressBook_) used for managing contact details. - * It is **written in OOP fashion**. It provides a **reasonably well-written** code base **bigger** (around 6 KLoC) than what students usually write in beginner-level SE modules, without being overwhelmingly big. - * It comes with a **reasonable level of user and developer documentation**. -* It is named `AddressBook Level 3` (`AB3` for short) because it was initially created as a part of a series of `AddressBook` projects (`Level 1`, `Level 2`, `Level 3` ...). -* For the detailed documentation of this project, see the **[Address Book Product Website](https://se-education.org/addressbook-level3)**. -* This project is a **part of the se-education.org** initiative. If you would like to contribute code to this project, see [se-education.org](https://se-education.org#https://se-education.org/#contributing) for more info. +## Useful Links +### Features and User Guide +Refer to the [User Guide](docs/UserGuide.md) for a detailed walk-through of how to use Bamboo. + +### Developer Guide +Interested in contributing to Bamboo? The [Developer Guide](docs/DeveloperGuide.md) is a good place to start. + +### About Us +Find out more about us [here](docs/AboutUs.md). + +## Acknowledgements +* This project is based on the AddressBook-Level3 project created by the [SE-EDU initiative](https://se-education.org). diff --git a/build.gradle b/build.gradle index be2d2905dde..e9e2b8c7e50 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,7 @@ plugins { id 'jacoco' } -mainClassName = 'seedu.address.Main' +mainClassName = 'seedu.expense.Main' sourceCompatibility = JavaVersion.VERSION_11 targetCompatibility = JavaVersion.VERSION_11 @@ -20,6 +20,10 @@ checkstyle { toolVersion = '8.29' } +run { + enableAssertions = true +} + test { useJUnitPlatform() finalizedBy jacocoTestReport @@ -66,7 +70,7 @@ dependencies { } shadowJar { - archiveName = 'addressbook.jar' + archiveName = 'expensebook.jar' } defaultTasks 'clean', 'test' diff --git a/docs/AboutUs.md b/docs/AboutUs.md index 1c9514e966a..85e1383966f 100644 --- a/docs/AboutUs.md +++ b/docs/AboutUs.md @@ -5,55 +5,61 @@ title: About Us We are a team based in the [School of Computing, National University of Singapore](http://www.comp.nus.edu.sg). -You can reach us at the email `seer[at]comp.nus.edu.sg` +You can reach us through our respective emails. ## Project team -### John Doe +### Maxx Chan - + -[[homepage](http://www.comp.nus.edu.sg/~damithch)] -[[github](https://github.com/johndoe)] -[[portfolio](team/johndoe.md)] +[[github](https://github.com/maxxyh)] +[[portfolio](team/maxxyh.md)] +[[email](mailto:maxxchan@u.nus.edu)] -* Role: Project Advisor +* Role: Team Lead, Developer +* Responsibilities: Scheduling and Tracking, Deliverables and Deadlines -### Jane Doe +### Hakiem Rasid - + -[[github](http://github.com/johndoe)] -[[portfolio](team/johndoe.md)] +[[github](http://github.com/hakiem526)] +[[portfolio](team/hakiem526.md)] +[[email](mailto:e0325825@u.nus.edu)] -* Role: Team Lead -* Responsibilities: UI +* Role: Developer +* Responsibilities: Testing -### Johnny Doe +### Jaylen Lee - + -[[github](http://github.com/johndoe)] [[portfolio](team/johndoe.md)] +[[github](http://github.com/Jaylenlee)] +[[portfolio](team/jaylenlee.md)] +[[email](mailto:e0424677@u.nus.edu)] * Role: Developer -* Responsibilities: Data +* Responsibilities: Integration -### Jean Doe +### Leben Chew - + -[[github](http://github.com/johndoe)] -[[portfolio](team/johndoe.md)] +[[github](http://github.com/lebencwb)] +[[portfolio](team/lebencwb.md)] +[[email](mailto:leben.chew@u.nus.edu)] * Role: Developer -* Responsibilities: Dev Ops + Threading +* Responsibilities: UI/UX -### James Doe +### Marcus Ng - + -[[github](http://github.com/johndoe)] -[[portfolio](team/johndoe.md)] +[[github](http://github.com/marcus2k)] +[[portfolio](team/marcus2k.md)] +[[email](mailto:marcus@u.nus.edu)] * Role: Developer -* Responsibilities: UI +* Responsibilities: Code Quality diff --git a/docs/DevOps.md b/docs/DevOps.md index 4414eea3344..94b9e4d2bee 100644 --- a/docs/DevOps.md +++ b/docs/DevOps.md @@ -44,7 +44,7 @@ As part of CI, this project uses Codecov to generate coverage reports. Here are 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/AY2021S1-CS2103-W14-3/tp/branch/master/graph/badge.svg)](https://codecov.io/gh/AY2021S1-CS2103-W14-3/tp) in that page reflects the coverage of your project. ### Repository-wide checks @@ -73,7 +73,7 @@ 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/AY2021S1-CS2103-W14-3/tp/tree/master/src/main/java/seedu/expense/MainApp.java). 1. Generate a fat JAR file using Gradle (i.e., `gradlew shadow`). 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. diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index 4829fe43011..342d36bbad8 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -23,11 +23,11 @@ The ***Architecture Diagram*** given above explains the high-level design of the
-:bulb: **Tip:** The `.puml` files used to create diagrams in this document can be found in the [diagrams](https://github.com/se-edu/addressbook-level3/tree/master/docs/diagrams/) folder. Refer to the [_PlantUML Tutorial_ at se-edu/guides](https://se-education.org/guides/tutorials/plantUml.html) to learn how to create and edit diagrams. +:bulb: **Tip:** The `.puml` files used to create diagrams in this document can be found in the [diagrams](https://github.com/AY2021S1-CS2103-W14-3/tp/tree/master/docs/diagrams/) folder. Refer to the [_PlantUML Tutorial_ at se-edu/guides](https://se-education.org/guides/tutorials/plantUml.html) to learn how to create and edit diagrams.
-**`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/AY2021S1-CS2103-W14-3/tp/tree/master/src/main/java/seedu/expense/Main.java) and [`MainApp`](https://github.com/AY2021S1-CS2103-W14-3/tp/tree/master/src/main/java/seedu/expense/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. @@ -62,11 +62,11 @@ The sections below give more details of each component. ![Structure of the UI Component](images/UiClassDiagram.png) **API** : -[`Ui.java`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/java/seedu/address/ui/Ui.java) +[`Ui.java`](https://github.com/AY2021S1-CS2103-W14-3/tp/tree/master/src/main/java/seedu/expense/ui/Ui.java) -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. +The UI consists of a `MainWindow` that is made up of parts e.g.`CommandBox`, `ResultDisplay`, `ExpenseListPanel`, `StatusBarFooter` etc. All these, including the `MainWindow`, inherit from the abstract `UiPart` class. -The `UI` component uses 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 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/AY2021S1-CS2103-W14-3/tp/tree/master/src/main/java/seedu/expense/ui/MainWindow.java) is specified in [`MainWindow.fxml`](https://github.com/AY2021S1-CS2103-W14-3/tp/tree/master/src/main/resources/view/MainWindow.fxml) The `UI` component, @@ -78,11 +78,11 @@ The `UI` component, ![Structure of the Logic Component](images/LogicClassDiagram.png) **API** : -[`Logic.java`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/java/seedu/address/logic/Logic.java) +[`Logic.java`](https://github.com/AY2021S1-CS2103-W14-3/tp/tree/master/src/main/java/seedu/expense/logic/Logic.java) -1. `Logic` uses the `AddressBookParser` class to parse the user command. +1. `Logic` uses the `ExpenseBookParser` class to parse the user command. 1. This results in a `Command` object which is executed by the `LogicManager`. -1. The command execution can affect the `Model` (e.g. adding a person). +1. The command execution can affect the `Model` (e.g. adding a expense). 1. The result of the command execution is encapsulated as a `CommandResult` object which is passed back to the `Ui`. 1. In addition, the `CommandResult` object can also instruct the `Ui` to perform certain actions, such as displaying help to the user. @@ -97,17 +97,17 @@ Given below is the Sequence Diagram for interactions within the `Logic` componen ![Structure of the Model Component](images/ModelClassDiagram.png) -**API** : [`Model.java`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/java/seedu/address/model/Model.java) +**API** : [`Model.java`](https://github.com/AY2021S1-CS2103-W14-3/tp/tree/master/src/main/java/seedu/expense/model/Model.java) The `Model`, * stores a `UserPref` object that represents the user’s preferences. -* stores the address book data. -* exposes 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 the expense book data. +* exposes 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. * does not depend on any of the other three 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` object.
+
:information_source: **Note:** An alternative (arguably, a more OOP) model is given below. It has a `Tag` list in the `ExpenseBook`, which `Expense` references. This allows `ExpenseBook` to only require one `Tag` object per unique `Tag`, instead of each `Expense` needing their own `Tag` object.
![BetterModelClassDiagram](images/BetterModelClassDiagram.png)
@@ -117,15 +117,15 @@ The `Model`, ![Structure of the Storage Component](images/StorageClassDiagram.png) -**API** : [`Storage.java`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/java/seedu/address/storage/Storage.java) +**API** : [`Storage.java`](https://github.com/AY2021S1-CS2103-W14-3/tp/tree/master/src/main/java/seedu/expense/storage/Storage.java) The `Storage` component, * can save `UserPref` objects in json format and read it back. -* can save the address book data in json format and read it back. +* can save the expense book data in json format and read it back. ### Common classes -Classes used by multiple components are in the `seedu.addressbook.commons` package. +Classes used by multiple components are in the `seedu.expense.commons` package. -------------------------------------------------------------------------------------------------------------------- @@ -133,90 +133,262 @@ 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 +### Category Account Switching Feature -#### Proposed Implementation +#### Implementation -The proposed undo/redo mechanism is facilitated by `VersionedAddressBook`. It extends `AddressBook` with an undo/redo history, stored internally as an `addressBookStateList` and `currentStatePointer`. Additionally, it implements the following operations: +The switching mechanism is facilitated by `ExpenseBook` and initialised by +`Model#switchCategory(Tag category)`. Additionally, `ExpenseBook` implements the following operations: -* `VersionedAddressBook#commit()` — Saves the current address book state in its history. -* `VersionedAddressBook#undo()` — Restores the previous address book state from its history. -* `VersionedAddressBook#redo()` — Restores a previously undone address book state from its history. +* `ExpenseBook#containsCategory(Tag toCheck)` — Checks if the given tag matches the tag of category budget. +* `ExpenseBook#updateExpenseBookCategory(Tag category)` - Updates the expense to only show expenses and budgets that matches the category. +* `ExpenseBook#updateFilteredBudgets(Predicate predicate)` — Filters the budget list to the given predicate. +* `ExpenseBook#updateFilteredExpenses(Predicate predicate)` — Filters the expense list to the given predicate . -These operations are exposed in the `Model` interface as `Model#commitAddressBook()`, `Model#undoAddressBook()` and `Model#redoAddressBook()` respectively. +These operations are exposed in the `Model` interface as +* `Model#hasCategory(Tag toCheck)` +* `Model#updateExpenseBookCategory(Tag category)` +* `Model#updateFilteredExpenseList(Predicate predicate)` +* `Model#updateFilteredBudgetList(Predicate predicate)` -Given below is an example usage scenario and how the undo/redo mechanism behaves at each step. +Given below is a successful usage scenario example and how the switching mechanism behaves at each step. -Step 1. The user launches the application for the first time. The `VersionedAddressBook` will be initialized with the initial address book state, and the `currentStatePointer` pointing to that single address book state. +Step 1. The user launches the application for the first time. The `ExpenseBook` will be initialized with the +initial expense book state in Model. -![UndoRedoState0](images/UndoRedoState0.png) +Step 2. The user executes `switch t/Food` command to switch to `ExpenseBook` with "Food" tag in category budget +and expenses in the expense book. The `switch` command calls `Model#switchCategory(Tag category)`. The method then +calls the operations mentioned [above](#switchOperations) causing the category budgets and expenses to be filtered. -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. +The following sequence diagram shows how the switch operation works: -![UndoRedoState1](images/UndoRedoState1.png) +![SwitchSequenceDiagram](images/SwitchSequenceDiagram.png) +![SwitchSequenceDiagram2](images/SwitchSequenceDiagram2.png) +![SwitchSequenceDiagram3](images/SwitchSequenceDiagram3.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`. +
:information_source: **Note:** The lifeline for `SwitchCommand` +should end at the destroy marker (X) but due to a limitation of PlantUML, the lifeline reaches the end of diagram. +
-![UndoRedoState2](images/UndoRedoState2.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 then decides to execute the command `topup`. Commands that modify the expense book, +such as `topup`, `delete`, `edit`, will usually call their respectively method in Model. As such the budget balance +display of the application will change accordingly to reflect on their corresponding values. -
+Step 4. The user then decides to execute the command `list`. Commands that do not modify the expense book but have strong +relationship with altering the budget display such as `list`, will usually revert the displayed budget to the overall +amount instead of category-specific. In addition, the expenses calculated will be based on the displayed list total +amount. -Step 4. The user now decides that adding the person was a mistake, and decides to undo that action by executing the `undo` command. The `undo` command will call `Model#undoAddressBook()`, which will shift the `currentStatePointer` once to the left, pointing it to the previous address book state, and restores the address book to that state. +Step 5. The user then decides to execute the command `find`. Commands that do not modify the expense book and do not +have a clear relationship with the budget display such as `find`, will usually omit out the budget display after +their execution. However, exceptions are given to command such as `help`, `exit` which will not alter the visibility +of the current budget display. -![UndoRedoState3](images/UndoRedoState3.png) +#### Design consideration: -
: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. +##### Aspect: How Category switching executes -
+* **Alternative 1 (current choice):** Filters the entire expense book by category tag. + * Pros: Easy to implement. + * Cons: May have performance issues in terms of execution speed. (Require repeated calculation and filtering) -The following sequence diagram shows how the undo operation works: +* **Alternative 2:** Create multiple expense books for each category. + * Pros: Will be faster during execution. (Calculation and sorting/filtering are done during initialisation) + * Cons: Slower initialisation and higher overhead cost and more memory used. -![UndoSequenceDiagram](images/UndoSequenceDiagram.png) +### Expense Sorting Feature -
: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. +#### Implementation -
+The expense sorting command is facilitated by `UniqueExpenseList` and `ExpenseBook`. In addition +, a new `Command` subclass, `SortCommand`, is required. Specifically, the following operations are relevant to this + command: -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. +* `ExpenseBook#sortExpenses(Comparator comparator)` — Sorts its `UniqueExpenseList` according to the comparator + provided. +* `UniqueExpenseList#sortExpenses(Comparator comparator)` — Sorts its `ObservableList` according to the + comparator provided. -
: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. +These operations are exposed in the `Model` interface as `Model#sortExpenseList(Comparator comparator)` -
+##### `SortCommand` and `SortCommandParser` + +`SortCommand` will take in at least one, and up to three keywords which specify the order and the parameters to sort + by (date, description, amount). The conversion of the `String` input to a `SortKeyComparator`, which implements `Comparator`, is facilitated by + `SortCommandParser#parse()`, and the **order** of the sorting parameters is implemented via the `Comparator#thenComparing()` method. + +The concrete implementation of the `#Compare(Expense other)` method is present in subclasses of `SortKeyComparator`: `AmountComparator`, `DateComparator`, and `DescriptionComparator`. +These are the methods that are called when combining `SortKeyComparators` through the `Comparator#thenComparing()` method. + +Command Example: +* `sort -by date` — Sorted by chronological order. +* `sort -by date -by descriptionR` — Sorted in chronological order, then based on reverse alphabetical + order of descriptions. +* `sort -by date -by amount -by description` — Sorted in following order of priority: Chronological order, then by + increasing order of amounts, then by alphabetical order of descriptions. + +##### Example Usage +Given below is an example usage scenario and how the sorting command behaves at each step. + +Step 1. The user launches the application. The `ExpenseBook` shows the list of expenses in the expense book. + +Step 2. The user executes `sort by/date by/descriptionR` command to sort the `Expenses` in `ExpenseBook` first by + date, then in reverse alphabetical order of the descriptions. + A comparator is created reflecting the above sorting. + The `sort` command calls `Model#sortExpenseList(Comparator c)`, causing the `ExpenseBook` expenses to be + sorted according to the comparator, and the `filteredExpenses` in `Model` to be modified since it is a listener. -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. +The following sequence diagrams shows how the sort command works: +![SortSequenceDiagram Pt1](images/SortSequenceDiagram1.png) -![UndoRedoState4](images/UndoRedoState4.png) +![SortSequenceDiagram Pt2](images/SortSequenceDiagram2.png) -Step 6. The user executes `clear`, which calls `Model#commitAddressBook()`. Since the `currentStatePointer` is not pointing at the end of the `addressBookStateList`, all address book states after the `currentStatePointer` will be purged. Reason: It no longer makes sense to redo the `add n/David …​` command. This is the behavior that most modern desktop applications follow. +
:information_source: **Note:** The lifeline for `SortCommand` and + `Comparator` should end at the destroy marker (X) but due to a limitation of PlantUML, the lifeline reaches the end of diagram. +
-![UndoRedoState5](images/UndoRedoState5.png) +Step 3. The user then decides to execute the command `delete`. Commands that modify the expense book, such as `delete`, `edit`, will usually call their respectively method in Model, but using the new index ordering of the sorted list. -The following activity diagram summarizes what happens when a user executes a new command: +Step 4. The user then decides to execute the command `list`. This will revert the display view to initial + `ExpenseBook`. -![CommitActivityDiagram](images/CommitActivityDiagram.png) #### Design consideration: -##### Aspect: How undo & redo executes +##### Aspect: How Sorting Command executes -* **Alternative 1 (current choice):** Saves the entire address book. +* **Alternative 1 (current choice):** Add an additional sort on top of current list implementation. * Pros: Easy to implement. - * Cons: May have performance issues in terms of memory usage. + * Cons: Lack customizability in list views. + +* **Alternative 2:** Create multiple list views each representing a particular sort. + * Pros: Greater degree of customisation with regards to GUI. + * Cons: Difficult to implement as it requires the creation of multiple subclasses of `ListCommand`. + +### Customisation of Command Keywords using Alias Feature + +#### Implementation + +The implementation for the customisation of command keyword shortcuts for various `Command` subclasses is by introducing a class called `AliasMap` which stores mappings between a command shortcut ('alias') and the actual command word of the class, as well as a class called `AliasCommand` which takes in two user input as parameters. The first parameter is the default command word for which the user wishes to create an alias, or if there is an existing alias for the command word, it must be the existing alias for which the user wishes to alter into a new alias. The second keyword determines what the command's (new) alias would be. + +Sample usage: By default, the only command word for `FindCommand` is `"find"` + +* `alias find get` -> The user can now trigger a `FindCommand` with `"get"` alias. The `"find"` command word will still work. +* `alias get find` -> The "get" alias is removed from `AliasMap` object and only `"find"` can now trigger `FindCommand`. In other words, `FindCommand` no longer has an alias. + +To maintain some degree of simplicity and neatness, we require that `AliasCommand` and `ResetAliasCommand` cannot have aliases themselves. Furthermore, any custom alias is restricted to 10 case-sensitive alphabetical characters and each command can only have up to a single alias at any point in time. Default command words of each `Command` subclasses cannot be used as aliases. + +To allow for customisation to remain even after the user exits the app and subsequently restarts it, a customised alias-to-command mapping will be stored in JSON format, which can be converted to `AliasMap` and `AliasEntry` objects when Bamboo runs. + +The `ExpenseBookParser`'s `parseCommand()` method takes in an AliasMap object in addition to the user input, which allows the parser to map aliases to the default keyword and allows the execution of the associated `Command` object. + +Step 1. The user launches the application for the first time. Assume no alias is present (by default, aliases in the JSON file will be the default command word). + +Step 2. The user inputs `alias find get` to update the alias for `FindCommand` as `”get”`. +This will not only update the current AliasMap object, but will also update the JSON mapping with the help of StorageManager which handles all types of storage including JsonAliasMapStorage. + +The following is a sequence diagram showing how it works: +![AliasSequenceDiagram](images/AliasSequenceDiagram.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. +Step 3. The user can now use the following command to trigger a FindCommand. +* `get -d lunch at macs` + +#### Design consideration: + +##### Aspect: How alias executes +* **Alternative 1 (current choice):** Allows aliases of all command words except for `AliasCommand`. Does not override default command words but merely adds an alias. Reserved keywords cannot be applied unless it is for its associated subclass (i.e. removing the custom alias). + * Pros: Neater implementation especially if the user might frequently change his alias. + * Cons: Restricts degree of customisation. + +* **Alternative 2:** Allows aliases of all command words. Does not override default command words but merely adds an alias. Reserved keywords cannot be applied unless it is for its associated subclass (i.e. removing the custom alias). + * Pros: More flexibility than Alternative 1. + * Cons: Restricts degree of customisation due to reserved keywords not being allowed to use as alias for other Commands. + +* **Alternative 3:** Allows customisation of ALL command words. + * Pros: Highest degree of flexibility, better for users who can easily get used to Command Line Apps. + * Cons: May be messy and slower learning users may get confused. _{more aspects and alternatives to be added}_ -### \[Proposed\] Data archiving +### Default Category + +The function of the default category is to subsume all "untagged" `expenses` under some category. +This is especially important for possible occasions such as when the User uses the application without any categories, +or when the User deletes a category that existing `expenses` are linked to. + +#### Implementation + +The default category generally functions the same way as any user-created category, except that it cannot be deleted or +renamed. It is contained separately from the user-created categories (if any) for this reason. If a new ExpenseBook is +started, the default category is automatically initialized so that the User can use the full range of the basic +features even without creating customized categories. + +### Expense and Budget Categorization Feature + +The budgets and expenses in the expense book are grouped according to the user's specifications, as they can freely create +the categories that they need, top-up the desired amount for each category, and tag their expenses (both new and old) to +the respective categories to keep track of their spending. + +#### Implementation + +Each expense is tagged to exactly one category, and the category must exist in the expense book before any expenses can +be tagged to it. When a category is created in the expense book, the corresponding budget is automatically initialized +with zero amount. Thereafter, the user can top-up (or reduce) each budget accordingly, and the balance after deducting +all expenses within that category is shown to the user. + +![AddingCategorizedExpenseActivityDiagram](images/CategoryBudgetActivityDiagram.png) -_{Explain here how the data archiving feature will be implemented}_ +The activity diagram above shows a possible flow of the user attempting to add an expense tagged to a specific category. +![ToppingUpCategoryBudgetActivityDiagram](images/CategoryBudgetActivityDiagram2.png) + +This second activity diagram shows a possible flow of the user trying to top-up the budget of a specific category. + +### Graphical Representation Feature + +#### Implementation + +The graphical representation feature will allow the user to view a pie chart of his/her total spending, with each wedge representing the percentage of spending that corresponds to a specific tag. +This graphical representation will be displayed on `GraphDisplayWindow` upon the execution of `GraphCommand`. This mechanism will be facilitated by `PieChartData` to retrieve the required data from `ExpenseBook`. +`PieChartData` extends `ChartData` which allows abstracting out the implementation of different graphical representation formats for future versions. + +* `PieChartData#collectData(ObservableList)` — Retrieves required data. +* `PieChartData#getData()` — Returns data of each `Tag` and the corresponding total expenditure. + +The interactions between `ExpenseBook` (which contains the in-memory data of expenses) and `GraphicalDisplayWindow` (which specifies the UI displayed) facilitated by `PieChartData` is given below.
+ +![ClassDiagram](images/GraphicalRepresentationClassDiagram.png) + +The user initiates this function by executing the graph command. Refer Logic Component architecture diagram for the mechanism by which strings are read and parsed into Command objects. + +The sequence diagram below shows the proposed mechanism by which the required data necessary to initialise a pie chart is retrieved. This data is then used to format the UI output. + +![SequenceDiagram](images/GraphicalRepresentationSequenceDiagram.png) + +
:information_source: **Note:** Expenses that are untagged will be displayed as a single group. Tags should not be case sensitive. + +
+ +A possible edge case would be the user having empty expense record prior to executing the graph command. In such a case, the program will display a default message. + +The following activity diagram summarizes what happens when a user enters a graph command: + +![ActivityDiagram](images/GraphicalRepresentationActivityDiagram.png) + +#### Points to Note: + +* **UI classes to only act as placeholders** + * UI formatting is separated from the backend logic. + * Allows for dynamic updating of graphs. + +* **Data retrieval occurs upon every execution** + * Updates graph accordingly. + * Will not show outdated graphs. + +* **Easily extensible** + * Different sub-classes of `ChartData` can be implemented to collect a variety of meaningful data from `ExpenseBook` to be displayed by various UI classes in different formats. -------------------------------------------------------------------------------------------------------------------- @@ -236,71 +408,377 @@ _{Explain here how the data archiving feature will be implemented}_ **Target user profile**: -* has a need to manage a significant number of contacts -* prefer desktop apps over other types -* can type fast -* prefers typing to mouse interactions -* is reasonably comfortable using CLI apps +* is a college student +* spends money mainly on food, transportation, social life and material goods +* wants to keep track of his personal expenses +* considers oneself as "tech-folk" +* is familiar and comfortable with the command line +* types fast +* wants to set and keep to a budget +* likes things that are fast and simple +* is attached +* pays for his own bills +* is all for cashless +* is cautious about digital security +* prefers storing things digitally rather than on paper +* likes flexibility/customization +* plays games and likes achievements +* is not earning income +* is lazy enough to find a solution to manage his expenses for him + +**Value proposition**: manage expenses faster and simpler than a typical mouse/GUI driven app -**Value proposition**: manage contacts 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 | +| Priority | As a …​ | I want to …​ | So that I can…​ | +| -------- | ------------------------------------------ | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `* * *` | user | add a new expense | update my new spending | +| `* * *` | user | delete an expense | remove entries that I no longer need | +| `* * *` | user | set a budget | track if I am sticking to my financial goals | +| `* * *` | user | top up a budget | increase my spending limit | +| `* * *` | user | edit an expense | change details of the expense that is outdated or wrong | +| `* *` | organized user | categorise my expenditure | better segregate and manage various areas of my spending | +| `* *` | new user | use a help command | refer to instructions when I forget how to use the App | +| `* *` | efficient user | customise my command keywords | customize my user experience and workflow according to my preferences | +| `* *` | user with many expenses | find expenses via date, keywords, or category | locate a specific expense easily | +| `* *` | careless user | sort expenses based on date, description, or amount | organise my expenses better and gain a big picture view | +| `*` | meticulous user | track my saving progress to buy big ticket items | know how far away am I from the target | +| `*` | user who likes to see progress | use a progress tracker to motivate myself | keep working at saving up | +| `*` | cautious user | view my ledger data in a human-readable format and only edit the file when commands are executed | be assured that the accounts are updated and accurate | +| `*` | long-time user | archive older data from my view | manage my expenses easier | +| `*` | careless user | revert my commands | easily undo changes I made to my budgeting | +| `*` | user who likes to plan in advance | simulate future spending | visualize my journey towards my financial goals | +| `*` | forgetful user | receive notifications of budget limits and bill payments | better plan for daily expenditure and make payments on time | *{More to be added}* ### Use cases -(For all use cases below, the **System** is the `AddressBook` and the **Actor** is the `user`, unless specified otherwise) +(For all use cases below, the System is the Bamboo and the Actor is the user, unless specified otherwise) -**Use case: Delete a person** +#### Use case U1: Add an expense **MSS** -1. User requests to list persons -2. AddressBook shows a list of persons -3. User requests to delete a specific person in the list -4. AddressBook deletes the person +1. User requests to add an expense. +2. Bamboo adds the expense. +3. Bamboo lists all expenses and shows the new budget balance. Use case ends. **Extensions** +* 1a. The given command format is invalid. + * 1a1. Bamboo shows an error message. + + Use case ends. + +* 1b. The given field value is invalid. + * 1b1. Bamboo shows an error message. + + Use case ends. + +#### Use case U2: Top-up budget + +**MSS** + +1. User requests to top up a specified budget by an amount and category he provides. +2. Bamboo tops up the user's budget in the category and by the amount given by the user. +3. Bamboo updates the budget balance. + + Use case ends. + +**Extensions** + +* 1a. The given top-up value is invalid. + * 1a1. Bamboo shows an error message. + + Use case ends. + +* 1b. The given category value is invalid. + * 1b1. Bamboo shows an error message. + + Use case ends. + +#### Use case U3: Delete an expense + +**MSS** + +1. User requests to list expenses (U5). +2. Bamboo shows a list of expenses. +3. User requests to delete a specific expense in the list. +4. Bamboo deletes the expense. +5. Bamboo lists all expenses and shows the budget balance. + + Use case ends. + +**Extensions** + * 2a. The list is empty. Use case ends. -* 3a. The given index is invalid. - - * 3a1. AddressBook shows an error message. +* 3a. The given expense does not exist. + * 3a1. Bamboo shows an error message. Use case resumes at step 2. -*{More to be added}* +#### Use case U4: Edit an expense + +**MSS** -### Non-Functional Requirements +1. User requests to list expenses (U5). +2. Bamboo shows a list of expenses. +3. User requests to edit an expense with the new fields given. +4. Bamboo edits the expense. +5. Bamboo feedbacks to user what was changed. +6. Bamboo lists all expenses and shows the new budget balance. -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. + Use case ends. -*{More to be added}* +**Extensions** + +* 2a. The list is empty. + * 2a1. Bamboo shows an error message + + Use case ends + +* 3a. The given field value is invalid. + * 3a1. Bamboo shows an error message. + + Use case ends. + +#### Use case U5: List all expenses + +**MSS** + +1. User requests to list all expenses. +2. Bamboo shows a list of all expenses recorded and the current budget balance. + + Use case ends. + +#### Use case U6: Add a remark to an expense + +**Preconditions:** +* Expense List is not empty. + +**MSS** +1. User requests to add a remark to specified expense item. +2. Bamboo adds remark to specified expense item. +3. Bamboo lists all expenses and shows the budget balance. + + Use case ends. + +**Extensions** + +* 1a. The given expense does not exist. + * 1a1. Bamboo shows an error message. + + Use case ends. + +* 1b. The given field value is invalid. + * 1b1. Bamboo shows an error message. + + Use case ends. + +#### Use case U7: Find an expense + +**MSS** + +1. User requests to find expense by certain identifiers and search terms. +2. Bamboo shows a list of expenses which match the identifiers and search terms, and shows the overall budget balance. + + Use case ends. + +**Extensions** + +* 1a. The given field values are invalid. + * 1a1. Bamboo shows an error message. + + Use case ends. + +#### Use case U8: Sort expense list +**MSS** + +1. User requests to sort currently displayed expenses by certain sort criterion. +2. Bamboo sorts the currently displayed expenses according to user-specified sort criterion. +3. Bamboo displays the sorted expenses to the user with the budget balance. + + Use case ends. + +**Extensions** + +* 1a. The given field values are invalid. + * 1a1. Bamboo shows an error message. + + Use case ends. + +#### Use case U9: Add category +**MSS** + +1. User requests to add a new category with a user-specified category name. +2. Bamboo creates a new category with the user-specified name and shows a success message. +3. Bamboo lists all expenses and shows the budget balance. + + Use case ends. + +**Extensions** + +* 1a. The given field values are invalid. + * 1a1. Bamboo shows an error message. + + Use case ends. + +* 1b. The given category name already exists. + * 1b1. Bamboo shows an error message. + + Use case ends. + +#### Use case U10: Delete category +Similar to U9, except it's the opposite. + +**Extensions** + +* 1a. The given field values are invalid. + * 1a1. Bamboo shows an error message. + + Use case ends. + +* 1b. The given category name does not exist. + * 1b1. Bamboo shows an error message. + + Use case ends. + +* 1c. The given category name is restricted e.g. `Default` category. + * 1c1. Bamboo shows an error message. + + Use case ends. + +#### Use case U11: Switch category +**MSS** + +1. User requests to switch to a user-specified category +2. Bamboo shows all expenses which are tagged under the user-specified category, along with the budget for that category. + + Use case ends. + +**Extensions** + +* 1a. The given field values are invalid. + * 1a1. Bamboo shows an error message. + + Use case ends. + +* 1b. The given category does not exist. + * 1b1. Bamboo shows an error message. + + Use case ends. + +#### Use case U12: Change Command Keyword +**MSS** + +1. User requests to change command keyword to a user-defined string. +2. Bamboo maps the command linked to the original command keyword to the user-defined string. + + Use case ends. + +**Extensions** + +* 1a. The given field values are invalid. + * 1a1. Bamboo shows an error message. + + Use case ends. + +* 1b. The user-defined string is already a command keyword. + * 1b1. Bamboo shows an error message. + + Use case ends. + +#### Use case U13: Reset Changed Command Keyword +**MSS** + +1. User requests to reset changed command keyword to default command keyword. +2. Bamboo clears the changed commands linked to the original command keyword. + + Use case ends. + +**Extensions** + +* 1a. No command keyword changed previously. + * 1a1. Bamboo shows an error message. + + Use case ends. + +#### Use case U15: Graph Command Keyword +**MSS** + +1. User requests to view graph of his personal finance. +2. Bamboo displays a pop-up window containing a pie chart showing amount spent for each category. + + Use case ends. + +**Extensions** + +* 1a. User has not recorded any expenditures into the app. + * 1a1. Bamboo shows a blank pop-up window. + + Use case ends. + +#### Use case U14: Reduce Category Budget +**MSS** + +1. User requests to reduce a given amount of budget from a specific category. +2. Bamboo reduces the matching category-budget by the specified amount. +3. Bamboo shows the new budget amount for that category. +4. Bamboo updates the budget balance bar. + + Use case ends. + +**Extensions** + +* 1a. The category does not exist in the expense book. + * 1a1. Bamboo shows an error message. + + Use case ends. + +* 1b. The specified amount is invalid. + * 1b1. Bamboo shows an error message. + + Use case ends. + +* 1c. The specified amount exceeds the amount present in the specified budget. + * 1c1. Bamboo reduces the amount in the specified budget to zero. + * 1c2. Bamboo alerts the user that the amount reduced from the budget exceeded the amount present. + * 1c3. Bamboo updates the budget balance bar. + + Use case resumes from 4. + +### Non-Functional Requirement + +Project Constraints: + +* Product does not handle user's actual financial account +* User input in the form of command line +* System should be beginner-friendly +* User's spending data should be saved in an external storage file +* Storage file should be updated after each addition or update of spending data +* Product is offered as an offline application + +Process Requirements: + +* Project is expected to adhere to the set Milestones. +* User can execute actions using at most 1 command. ### Glossary -* **Mainstream OS**: Windows, Linux, Unix, OS-X -* **Private contact detail**: A contact detail that is not meant to be shared with others +- **Mainstream OS**: Windows, Linux, Unix, OS-X +- **Expense**: A single instance of expenditure containing a description, amount spent, date, and category. Expenses are subtracted from the user's **budget**. +- **Budget**: The amount a user sets aside to spend. +- **Budget Balance**: The amount of budget left after deducting all expenses. -------------------------------------------------------------------------------------------------------------------- @@ -320,6 +798,7 @@ testers are expected to do more *exploratory* testing. 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. + Alternatively, enter `java -jar expensebook-v1.4.jar` in Command Prompt after switching to the directory with the jar file. 1. Saving window preferences @@ -328,29 +807,70 @@ testers are expected to do more *exploratory* testing. 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 +### Deleting an expense -1. Deleting a person while all persons are being shown +1. Deleting an expense while all expenses are being shown - 1. Prerequisites: List all persons using the `list` command. Multiple persons in the list. + 1. Prerequisites: List all expenses using the `list` command. At least 1 expense 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. + Expected: First expense is deleted from the list. Details of the deleted expense shown in the command box with a uscess. 1. Test case: `delete 0`
- Expected: No person is deleted. Error details shown in the status message. Status bar remains the same. + Expected: No expense is deleted. Error details shown in the command box. 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 …​ }_ +### Adding an expense + +1. Adding an expense while Expense Book is empty. + + 1. Prerequisites: List all expenses using `list` command. Expense Book is empty. + + 1. Test case: `add -d lunch -$10`
+ Expected: An Expense with the description "lunch", costing $10, with the date set as the present date, is added to the expense book. A success message detailing this is shown in the command box. + + 1. Test case: `add -d lunch -$10 -@27/09/2020`
+ Expected: An Expense with the description "lunch", costing $10, occuring on 27th September 2020 is added to the expense book. A success message detailing this is shown in the command box. + + 1. Test cases: `add -d lunch`
+ Expected: No expense is added. Error details shown in the command box. + +1. Adding an expense while Expense Book has some expenses + + 1. Prerequisites: List all expenses using `list` command. Expense Book has at least 1 entry. + + 1. Test case: Add an expense with the same description, amount and date as an existing expense in the expense book.
+ Expected: No expense is added. Error details shown in the command box. + +### Topup budget + +1. Topping up budget without a category specified + + 1. Test case: `topup -$-10`
+ Expected: Budget is not topped up. Error message shown in command box because of negative value provided. + + 1. Test case: `topup -$10`
+ Expected: "Default" category budget is topped up by $10. A success message detailing this is shown in the command box. + +1. Topping up budget with a category specified + + 1. Test case: `topup -$10 t/Food` ("Food" category exists)
+ Expected: "Food" category budget is topped up by $10. A success message detailing this is shown in the command box. + + 1. Test case: `topup -$10 t/Transport` ("Transport" category does not exist yet)
+ Expected: No budget is topped up. Error message shown in command box because the "Transport" category does not exist. ### Saving data -1. Dealing with missing/corrupted data files +1. Saving data automatically after every command + + 1. Prerequisites: At least one expense is in the expense book. + + 1. Add an expense: `add -d test -$10` + + 1. Test case: Close the app, then start it up again.
+ Expected: the expense book should be the same as when the app was closed. - 1. _{explain how to simulate a missing/corrupted file, and the expected behavior}_ -1. _{ more test cases …​ }_ diff --git a/docs/SettingUp.md b/docs/SettingUp.md index b89b691fed9..50e7aff15b6 100644 --- a/docs/SettingUp.md +++ b/docs/SettingUp.md @@ -23,7 +23,7 @@ If you plan to use Intellij IDEA (highly recommended): 1. **Import the project as a Gradle project**: Follow the guide [_[se-edu/guides] IDEA: Importing a Gradle project_](https://se-education.org/guides/tutorials/intellijImportGradleProject.html) to import the project into IDEA.
:exclamation: Note: Importing a Gradle project is slightly different from importing a normal Java project. 1. **Verify the setup**: - 1. Run the `seedu.address.Main` and try a few commands. + 1. Run the `seedu.expense.Main` and try a few commands. 1. [Run the tests](Testing.md) to ensure they all pass. -------------------------------------------------------------------------------------------------------------------- @@ -45,11 +45,5 @@ If you plan to use Intellij IDEA (highly recommended): 1. **Learn the design** - When you are ready to start coding, we recommend that you get some sense of the overall design by reading about [AddressBook’s architecture](DeveloperGuide.md#architecture). + When you are ready to start coding, we recommend that you get some sense of the overall design by reading about [ExpenseBook’s architecture](DeveloperGuide.md#architecture). -1. **Do the tutorials** - These tutorials will help you get acquainted with the codebase. - - * [Tracing code](tutorials/TracingCode.md) - * [Removing fields](tutorials/RemovingFields.md) - * [Adding a new command](tutorials/AddRemark.md) diff --git a/docs/Testing.md b/docs/Testing.md index 8a99e82438a..fcde6ebc04b 100644 --- a/docs/Testing.md +++ b/docs/Testing.md @@ -29,8 +29,8 @@ There are two ways to run tests. This project has three types of tests: 1. *Unit tests* targeting the lowest level methods/classes.
- e.g. `seedu.address.commons.StringUtilTest` + e.g. `seedu.expense.commons.StringUtilTest` 1. *Integration tests* that are checking the integration of multiple code units (those code units are assumed to be working).
- e.g. `seedu.address.storage.StorageManagerTest` + e.g. `seedu.expense.storage.StorageManagerTest` 1. Hybrids of unit and integration tests. These test are checking multiple code units as well as how the are connected together.
- e.g. `seedu.address.logic.LogicManagerTest` + e.g. `seedu.expense.logic.LogicManagerTest` diff --git a/docs/UserGuide.md b/docs/UserGuide.md index b91c3bab04d..c5ffe6dfa46 100644 --- a/docs/UserGuide.md +++ b/docs/UserGuide.md @@ -1,178 +1,500 @@ ---- -layout: page -title: User Guide ---- - -AddressBook Level 3 (AB3) is a **desktop app for managing contacts, optimized for use via a Command Line Interface** (CLI) while still having the benefits of a Graphical User Interface (GUI). If you can type fast, AB3 can get your contact management tasks done faster than traditional GUI apps. - -* Table of Contents -{:toc} - --------------------------------------------------------------------------------------------------------------------- - -## Quick start - -1. Ensure you have Java `11` or above installed in your Computer. +# User Guide -1. Download the latest `addressbook.jar` from [here](https://github.com/se-edu/addressbook-level3/releases). +Bamboo (v1.4) is a **simple desktop app for managing personal finance, optimized for use via a Command Line Interface (CLI),** and targeted at college students. If you can type fast, Bamboo v1.4 can get your financial management tasks done faster than traditional GUI apps. -1. Copy the file to the folder you want to use as the _home folder_ for your AddressBook. -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.
- ![Ui](images/Ui.png) +This User Guide explains how you can use Bamboo to manage your personal finances. Let's grow our wealth! :bamboo: -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: +Refer to [Quick Start](#QuickStart) for a short tutorial on how to set up Bamboo on your system, and refer to [Features](#Features) for a full walk-through of Bamboo's features. - * **`list`** : Lists all contacts. - - * **`add`**`n/John Doe p/98765432 e/johnd@example.com a/John street, block 123, #01-01` : Adds a contact named `John Doe` to the Address Book. - - * **`delete`**`3` : Deletes the 3rd contact shown in the current list. - - * **`clear`** : Deletes all contacts. - - * **`exit`** : Exits the app. - -1. Refer to the [Features](#features) below for details of each command. - --------------------------------------------------------------------------------------------------------------------- +--- -## Features +## Table of contents -
+1. [Quick Start](#QuickStart) +2. [Features](#Features) +3. [Usage](#Usage) +4. [Command Summary](#CommandSummary) -**:information_source: Notes about the command format:**
+
-* 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`. +## Quick Start +> _Bamboo runs on Windows, OS-X, and Unix systems._ +1. Ensure that Java Version 11 or above is installed in your computer +2. Download the latest Bamboo Release `ExpenseBook.jar` [here](https://github.com/AY2021S1-CS2103-W14-3/tp/releases/tag/v1.4). +3. Copy the file to the folder you want to use as the home directory for Bamboo. +4. Double-click the file to start the app. It should open in a new window. + OR Navigate to the directory on terminal and run `java -jar ExpenseBook.jar`. +5. Type in commands with arguments in the command input box above, and press `Enter` to execute them. +6. Use the `help` command to find out the list of commands available, or we'd recommend checking out the +[Features](#Features) section for a comprehensive guide! +7. Let's grow our wealth together! -* 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`. +## Command Format Guide +
+This section explains the format of commands in this User Guide. -* 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. +* Items in are types of parameters to be supplied by the user e.g. in `add -d `, `` refers to a description of an expense such as "Lunch @ Thai Place". +* Items in square brackets are optional e.g `-d [-@]` means that date input is optional. Both `-d lunch` and `-d lunch -@03-09-2020` are valid. -* 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. +:bulb: **Note:** Command input is limited to 450 characters total (including command and parameters).
-### Viewing help : `help` +
+ +## Features + +### Basic +1. **Add an Expense** + - Adds new expense record. + - Command: `add` + - [Usage](#add) + +1. **List All Expenses** + - Displays a list of all the user's expenses. + - Command: `list` + - [Usage](#list) + +1. **Update an Expense** + - Edits existing expense record. + - Command: `edit` + - [Usage](#edit) + +1. **Delete an Expense** + - Deletes a specified existing expense record. + - Command: `delete` + - [Usage](#delete) + +1. **Top-up Budget** + - Increases the amount of budget (in the "Default" category) by a user-defined amount. + - Command: `topup` + - [Usage](#topup) + +1. **Show Help** + - Renders a help link to the commands in User Guide + - Command: `help` + - [Usage](#help) + +1. **Clear Expense Book** + - Clears and resets the expense book. + - Command: `clear` + - [Usage](#clear) + +1. **Exit Application** + - Exits Bamboo. + - Command: `exit` + - [Usage](#exit) + +1. **Save Load Function** + - Automatically saves the state of the expense book after each operation. + - Automatically loads previously saved data on app start-up. + +
+ +### Extension + +1. **Category Tagging** + - Tags expenses by their categories. + - Prefix: `t/` + - [Usage](#tag) + +2. **Adding Remark** + - Adds a remark to an existing expense. + - Command: `remark` + - [Usage](#remark) + +3. **Add Category** + - Adds a new category (for budgeting and expenses). + - Command: `addCat` + - [Usage](#addCat) + +4. **Delete Category** + - Deletes an existing category in the expense book. + - Command: `deleteCat` + - [Usage](#deleteCat) + +5. **Top-up Budget by Category** + - Increases the amount of budget in a specific category by a user-defined amount. + - Command: `topup` + - [Usage](#topup) + +6. **Reduce Budget (by Category)** + - Reduces the amount of budget in a specific category by a user-defined amount. + - Command: `reduce` + - [Usage](#reduce) + +7. **Switch Category** + - Switches an expense book into another existing category. + - Command: `switch` + - [Usage](#switch) + +8. **Find an Expense** + - Finds expenses by keywords, date, tags. + - Command: `find` + - [Usage](#find) + +
+ +9. **Sort Expenses** + - Sort by **date, description (alphabetical), amount**, with option of reverse sort. + - Command: `sort` + - [Usage](#sort) + +10. **Add Command Shortcut** + - Maps user-specified shortcut to existing command. + - Command: `alias` + - [Usage](#alias) + +11. **Reset Command Shortcuts** + - Removes all user-specified command shortcuts. + - Command: `resetAlias` + - [API](#resetAlias) + +12. **Display Graph** + - Opens a window that displays a pie chart representing categorical expenses. + - Command: `graph` + - [API](#graph) + +
+ +## Usage +For the purposes of Bamboo, the terms `Tag` and `Category` are interchangeable. +### Fields/Glossary +1. **expense** + - An expense is a cost incurred in or required for something. Every entry in **Bamboo** is an expense. + - Bamboo treats 2 expenses as identical if they have the same **Description**, **Amount**, and **Date**. + - Restrictions: Bamboo cannot store duplicate expenses i.e. 2 expenses are identical according to the criterion above. + - Refer to [Commands](#commands) to see how to manage expenses using Bamboo. + +2. **description** + - Description of expense. + - Works only in complement with [add](#add), [edit](#edit), [find](#find), [sort](#sort) + - Prefix: `-d` + - Format: `-d ` + - Restrictions: Descriptions can be up to 200 characters long. + - Example: `-d lunch`, `-d dinner` + +3. **amount** + - Amount of money spent in expense. + - **NOTE**: Amounts provided must be between 0 and 10e9 + - Works only in complement with [add](#add), [edit](#edit), [find](#find), [sort](#sort), [topup](#topup) + - Prefix: `-$` + - Format: `-$[.]` + - Restrictions: Value provided must be between 0 and 10e9, inclusive. + - Example: `-$2`, `-$1.50` + +
+ +4. **date** + - Date which expense was made. + - Works only in complement with [add](#add), [edit](#edit), [find](#find), [sort](#sort) + - Prefix: `-@` + - Format: `-@` + - Restrictions: Date must be a valid calendar date. + - Example: `-@01-07-2020`, `-@02-07-2020` + +5. **tag** + - Tags expense under a category. (synonymous with Category) + - Each tag (or category) is associated with 1 budget, and vice versa. + - Works only in complement with [add](#add), [edit](#edit), [find](#find), [switch](#switch), [addCat](#addCat), [deleteCat](#deleteCat), [topup](#topup) + - Format: `t/` + - Example: `edit t/Food`, `find -d Coffee t/Food` + +6. **remark** + - Additional information about an expense. + - Works only in complement with [remark](#remark) + - Format: `-r ` + - Restrictions: Remarks can be up to 200 characters long. + - Example: `remark 1 -r impulse spending`, `remark 2 -r emergency` + +7. **alias** + - "Also known as" for commands. + - Alternative shortcuts for commands can be used to invoke original commands. + - Added with [alias](#alias) command + - Format: `alias ` + - Input Restrictions: + - The shortcut cannot be the same as the original command. + - Original command must exist. + - Length of shortcut must not exceed 10 characters long. + - Shortcut may consist of only case-sensitive alphabetical characters. + - Cannot remap the `alias` and `resetAlias` commands. + - Only one shortcut for a command at any point in time. + - Example: `alias add spent` makes `spent` a command shortcut for `add` + + +
+ +:bulb: **Note:** Prefixes function with or without whitespace after. For example, `-d dinner` and `-ddinner` will yield the same results. -Shows a message explaning how to access the help page. - -![help message](images/helpMessage.png) - -Format: `help` - - -### Adding a person: `add` - -Adds a person to the address book. - -Format: `add n/NAME p/PHONE_NUMBER e/EMAIL a/ADDRESS [t/TAG]…​` - -
:bulb: **Tip:** -A person can have any number of tags (including 0)
-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` - -Shows a list of all persons in the address book. - -Format: `list` - -### Editing a person : `edit` - -Edits an existing person in the address book. - -Format: `edit INDEX [n/NAME] [p/PHONE] [e/EMAIL] [a/ADDRESS] [t/TAG]…​` - -* 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. - -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` - -Finds persons whose names contain any of the given keywords. - -Format: `find KEYWORD [MORE_KEYWORDS]` - -* 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` - -Deletes the specified person from the address book. - -Format: `delete INDEX` - -* 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, …​ - -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` - -Clears all entries from the address book. - -Format: `clear` - -### Exiting the program : `exit` - -Exits the program. - -Format: `exit` - -### Saving the data - -AddressBook data are saved in the hard disk automatically after any command that changes the data. There is no need to save manually. - -### Archiving data files `[coming in v2.0]` - -_{explain the feature here}_ - --------------------------------------------------------------------------------------------------------------------- - -## 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. - --------------------------------------------------------------------------------------------------------------------- - -## 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` +
+ +### Commands +1. **Add an Expense `add`** + - Order of arguments is flexible. + - If multiple fields of the same type are specified, only the last one is processed. + - Date input (dd-MM-yyyy) is optional, defaults to system's date (usually today). + - Tag (or category) input is optional, defaults to the "Default" category. This means that the expense is subtracted from the "Default" Budget. + - Format: `add -d -$ [-@] [t/]` + - Example: `add -d dinner -$10.50` Adds the expense to **current date's** record. + - Example: `add -d dinner -$10.50 -@24-06-2020 t/Food` Adds the expense under **24 June 2020** and tags it under "Food" category. + + _**Specifying Category/Tag**_ + - Example: `add -d dinner -$10.50 -@20-08-2020 t/Food t/Basic` As stated above, only `t/Basic` is processed, thus the expense is tagged with the "Basic" category, if it exists. + - Input constraints: + - If specified, the tag input must match one of the existing categories in the expense book. If not, the + expense will be added to the "Default" category - the new category needs to be created first (see [addCategory](#addCat)) + - The expense to be added must not share the same identity fields (description, amount and date) as any expense in the expense book. + - Total sum of expenses cannot exceed 10e9 (_Consistent with `Amount`_) + + ![add_example](images/ug_example/add_example.PNG) +   + +1. **List all Expenses `list`** + - Displays all the items in the list. + - Displays the budget balance based on **total expenditure** against the **total sum of all budgets**. + - Format: `list` + - Example: `list` + + ![list_example](images/ug_example/list_example.PNG) +   + +1. **Edit an Expense `edit`** + - Edits the fields of existing expenses. + - Identified by index starting from 1, based on expenses currently displayed. + - Order of arguments is flexible except index. + - Edited fields overwrite the previous field completely. + - **At least 1 of the 4 fields** (description, amount, date, category) of expense must be specified. + - Format: `edit [-d ] [-$] [-@] [t/]` + - Example: `edit 1 -d lunch -$12.50` + - Example: `edit 11 -$12.50 -d lunch -@23-06-2020 t/Food` + - Input constraints: + - See [add](#add) +
+ + :bulb: **Note**: Specifying a blank tag field (e.g. `edit 1 t/`) is the same as editing the tag to the "Default" tag. + +
+ + ![edit_example](images/ug_example/edit_example.PNG) +   + + +1. **Delete an Expense `delete`** + - Deletes a specified existing expense record. + - Identified by index starting from 1, based on expenses currently displayed. + - Format: `delete ` + - Example: `delete 11` Deletes the item at index 11 of the list. + + ![delete_example](images/ug_example/delete_example.PNG) +   + +1. **Add a Category `addCat`** + - Adds a new category to the expense book. + - The category must not already exist in the expense book. + - Format: `addCat t/` + - Example: `addCat t/Food` + + ![addCat_example](images/ug_example/addCat_example.PNG) + _"Shopping" category is added_ + + ![addCat_example](images/ug_example/addCat_example_2.PNG) + _Use "Shopping" category_ +   + +1. **Delete a Category `deleteCat`** + - Deletes an existing category in expense book, if it exists. (Note: the "Default" category cannot be deleted.) + - Category budget of the deleted category will be deleted. + - All expenses tagged with deleted category will be reverted to "Default" category. + - Format: `deleteCat t/` + - Example: `deleteCat t/Food` + + ![deleteCat_example](./images/ug_example/deleteCat_example.PNG) + _Expense 9 is reverted from "Shopping" category to "Default" category_ +   + +1. **Top up Category Budget `topup`** + - Increases the budget of a **particular category** by the amount specified by the user. + - Expenses in the same category reduce the balance of the budget. + - Tag (or category) input is optional, defaults to the "Default" category. + - Format: `topup -$ [t/]` + - Example: `topup -$10` Increases the "Default" category's budget by 10 dollars. + - Example: `topup -$20 t/Food` Adds an extra budget of 20 dollars to the "Food" category-budget. + - Input constraints: + - The category specified must exist in the Expense Book. Otherwise, it must be [created](#addCat) before it can be topped up. + - The input amount must be non-negative (see [Amount](#amount)) and cannot exceed 10e9. + - The total amount of all the budgets cannot exceed 10e9. +
+ + :bulb: **Note**: Each budget is associated with 1 category, and vice versa. + +
+ + ![topup_example](images/ug_example/topup_example.PNG) +   + +1. **Reduce Category Budget `reduce`** + - Reduces the budget of a **particular category** by the amount specified by the user. + - The amount in any budget cannot fall below zero (any reduction in budget beyond the amount present would cause a _reduction to zero_). + - Tag (or category) input is optional, defaults to the "Default" category. + - Format: `reduce -$ [t/]` + - Example: `reduce -$10` Reduces the "Default" category's budget by 10 dollars. + - Example: `reduce -$5 t/Food` Reduces the amount in the "Food" category-budget by $5 (or to $0 if the original amount was insufficient). + - Input constraints: + - The category specified must exist in the Expense Book. Otherwise, it must be [created](#addCat) before it can be reduced. + - The input amount must be non-negative (see [Amount](#amount)) and cannot exceed 10e9. + + ![reduce_example](images/ug_example/reduce_example) +   + +1. **Find Expenses `find`** + - Finds expenses with given keywords and/or date by user. + - Expenses that fits the criteria will be presented as another list. + - For Description, keywords are not case-sensitive, and partial word matching is supported. + - Date input should be in the format dd-MM-yyyy. + - Budget Balance will not be shown in this view. + - Format: `find [-d ] [-@]` + - Example: `find -d Phone`, `find -d lunch -@01-07-2020` + + ![find_example](images/ug_example/find_example.PNG) + _Find by partial description keyword_ + + ![find_example_2](images/ug_example/find_example_2.PNG) + _Find by description keyword and date_ +   + +1. **Add a Remark `remark`** + - Adds a remark to an existing expense. + - Note: Remarks can be up to 200 characters long. + - Format: `remark -r ` + - Example: `remark 11 -r Pepper Lunch` + + ![remark_example](./images/ug_example/remark_example.PNG) +   + +1. **Sort Expenses `sort`** + - Sorts expenses which are current displayed. + - **Sorting keywords** (and thus criterion) include: + - expense amount: `amount` + - date: `date` + - description (alphabetical order): `description` + - Add a "R" behind sorting keywords to induce reversed sorting order + - Sorting criterion are assigned priority in order of appearance. + - A minimum of 1 sorting keyword is required + - Format: `sort -by [-by ] [-by ]` + - Example: `sort -by date -by descriptionR` (sorts by date, then by reversed alphabetical order of the descriptions) + + | ![sort_example](./images/ug_example/sort_example.PNG)
_Single parameter sort: ascending Date order_ | ![sort_example_2](./images/ug_example/sort_example_2.PNG)
_Multiple parameter sort: in order of appearance – date, then description, then amount (see Expenses 1 and 2)_ | + |------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + |![sort_example_3](./images/ug_example/sort_example_3.PNG)
_Multi-parameter sort will take the last sorting keyword if there are duplicates_|![sort_example_4](./images/ug_example/sort_example_4.PNG)
_Sorting after using `Find`_ | +   + +1. **Switch Category `switch`** + - Switches expense book to requested category. + - Displays all expenses tagged under requested category. + - Budget balance displayed below is also category-specific. + - Requested category must exist in expense book. + - Format: `switch t/` + - Example: `switch t/Food` +
+ + :bulb: **Note**: Can also switch to the "Default" category view. + +
+ + ![switch_example](./images/ug_example/switch_example.PNG) + _Budget balance displayed here is the budget for the "Food" category_ +   + +1. **Add Command Shortcut `alias`** + - Maps user-specified shortcut to existing command. + - Original command keyword will still function as before. + - Input Restrictions: + - The shortcut specified and the original command cannot be the same. + - Original command must exist. + - Length of shortcut must not exceed 10 characters long. + - Shortcut may consist of only case-sensitive alphabetical characters. + - Cannot remap the `alias` and `resetAlias` commands. + - Format: `alias ` + - Example: `alias add spent` + - Each command may only have up to one shortcut at each time. If a new shortcut is provided for a command, the old shortcut will be un-mapped. + - Reversing the two parameters will remove the particular shortcut from the command. + - Example: `alias spent add` + + ![alias_example](./images/ug_example/alias_example.PNG) + _Map "spent" to "add" command_ + + ![alias_example_2](./images/ug_example/alias_example_2.PNG) + _"spent" keyword can now function as "add"_ +   + + ![alias_example_3](./images/ug_example/alias_example_3.PNG) + _"spent" keyword can no longer function as "add"_ + +1. **Reset Command Shortcuts `resetAlias`** + - Removes all existing shortcuts defined by user. + - Format: `resetAlias` + - Example: `resetAlias` + + ![resetAlias_example](./images/ug_example/resetAlias_example.PNG) + +1. **Graph Command `graph`** + - Opens a window that displays a pie chart representing categorical expenses. + - Format: `graph` + - Example: `graph` + - Note: The pie chart does not update dynamically. + If a command that edits the Expense Book is entered while the graph window is open, the pie chart will not be updated. + User must re-enter the graph command to update the pie chart accordingly. + + ![graph_example](./images/ug_example/graph_example.PNG) + +1. **Display Help `help`** + - Displays a help link to the User Guide, which comprehensively covers Bamboo's commands. + - Format: `help` + - Example: `help` + + ![help_example](./images/ug_example/help_example.PNG) +   + +
+ +17. **Clear All Expenses `clear`** + - Clears all expenses from Bamboo, resulting in an empty expense book. + - Format: `clear` + - Example: `clear` + + ![clear_example](images/ug_example/clear_example.png) + +1. **Exit Application `exit`** + - Exits the application. + - Format: `exit` + +
+ +## Command Summary + +| Action | Format, Examples | +|---------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **Add** | `add -d -$ [-@] [t/]`
e.g., `add -d dinner -$10.50`, `add -d dinner -$10.50 -@20-08-2020 t/Food` | +| **List** | `list` | +| **Edit** | `edit [-d ] [-$] [-@] [t/]`
e.g.,`edit 1 -d lunch -$12.50`, `edit 1 -$12.50 -d lunch -@11-11-2020 t/Lunch`| +| **Delete** | `delete `
e.g., `delete 1` | +| **Topup** | `topup -$ [t/]`
e.g., `topup -$200`, `topup -$30 t/Food` | +| **Reduce** | `reduce -$ [t/]`
e.g., `reduce -$50`, `reduce -$40 t/Food` | +| **Find** | `find [-d ] [-@]`
e.g., `find -d lunch`, `find -d lunch -@01-07-2020` | +| **Remark** | `remark -r`
e.g., `remark 11 -r Pepper Lunch` | +| **Sort** | `sort -by [-by ] [-by ]`
e.g., `sort -by date -by descriptionR` | + +
+ +| **Switch** | `switch t/`
e.g., `switch t/Food` | +| **AddCat** | `addCat t/`
e.g., `addCat t/Food` | +| **DeleteCat** | `deleteCat t/`
e.g., `deleteCat t/Food` | +| **Alias** | `alias `
e.g., `alias add spent` | +| **ResetAlias**| `resetAlias` | +| **Graph** | `graph` | +| **Help** | `help` | +| **Clear** | `clear` | +| **Exit** | `exit` | diff --git a/docs/_config.yml b/docs/_config.yml index 6bd245d8f4e..321637cc058 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -1,4 +1,4 @@ -title: "AB-3" +title: "Bamboo" theme: minima header_pages: @@ -8,7 +8,7 @@ header_pages: markdown: kramdown -repository: "se-edu/addressbook-level3" +repository: "AY2021S1-CS2103-W14-3/tp" github_icon: "images/github-icon.png" plugins: diff --git a/docs/_data/projects.yml b/docs/_data/projects.yml index 8f3e50cb601..2ac2abb7d26 100644 --- a/docs/_data/projects.yml +++ b/docs/_data/projects.yml @@ -21,3 +21,7 @@ - name: "Resources" url: https://se-edu.github.io/resources + +- name: "Bamboo" + url: https://ay2021s1-cs2103-w14-3.github.io/tp/ + diff --git a/docs/diagrams/AliasSequenceDiagram.puml b/docs/diagrams/AliasSequenceDiagram.puml new file mode 100644 index 00000000000..7ecff98deca --- /dev/null +++ b/docs/diagrams/AliasSequenceDiagram.puml @@ -0,0 +1,45 @@ +@startuml +!include style.puml + +box Logic LOGIC_COLOR_T1 +participant ":LogicManager" as LogicManager LOGIC_COLOR +participant ":ExpenseBookParser" as ExpenseBookParser LOGIC_COLOR +participant "s:AliasCommand" as AliasCommand LOGIC_COLOR +end box + +box Model MODEL_COLOR_T1 +participant ":Model" as Model MODEL_COLOR +end box + +[-> LogicManager : execute("alias find get") +activate LogicManager + +LogicManager -> ExpenseBookParser : parseCommand("alias find get") +activate ExpenseBookParser + +create AliasCommand +ExpenseBookParser -> AliasCommand +activate AliasCommand + +AliasCommand --> ExpenseBookParser +deactivate AliasCommand + +ExpenseBookParser --> LogicManager : s +deactivate ExpenseBookParser + +LogicManager -> AliasCommand : execute() +activate AliasCommand + +AliasCommand -> Model : setAlias(prev, new) +activate Model + +Model --> AliasCommand +deactivate Model + +deactivate AliasCommand +AliasCommand --> LogicManager : result +destroy AliasCommand + +[<--LogicManager +deactivate LogicManager +@enduml diff --git a/docs/diagrams/ArchitectureSequenceDiagram.puml b/docs/diagrams/ArchitectureSequenceDiagram.puml index ef81d18c337..0014def2743 100644 --- a/docs/diagrams/ArchitectureSequenceDiagram.puml +++ b/docs/diagrams/ArchitectureSequenceDiagram.puml @@ -13,13 +13,13 @@ activate ui UI_COLOR ui -[UI_COLOR]> logic : execute("delete 1") activate logic LOGIC_COLOR -logic -[LOGIC_COLOR]> model : deletePerson(p) +logic -[LOGIC_COLOR]> model : deleteExpense(e) activate model MODEL_COLOR model -[MODEL_COLOR]-> logic deactivate model -logic -[LOGIC_COLOR]> storage : saveAddressBook(addressBook) +logic -[LOGIC_COLOR]> storage : saveExpenseBook(expenseBook) activate storage STORAGE_COLOR storage -[STORAGE_COLOR]> storage : Save to file diff --git a/docs/diagrams/BetterModelClassDiagram.puml b/docs/diagrams/BetterModelClassDiagram.puml index 29076104af3..b669b2f1b72 100644 --- a/docs/diagrams/BetterModelClassDiagram.puml +++ b/docs/diagrams/BetterModelClassDiagram.puml @@ -4,18 +4,18 @@ skinparam arrowThickness 1.1 skinparam arrowColor MODEL_COLOR skinparam classBackgroundColor MODEL_COLOR -AddressBook *-right-> "1" UniquePersonList -AddressBook *-right-> "1" UniqueTagList -UniqueTagList -[hidden]down- UniquePersonList -UniqueTagList -[hidden]down- UniquePersonList +ExpenseBook *-right-> "1" UniqueExpenseList +ExpenseBook *-right-> "1" UniqueTagList +UniqueTagList -[hidden]down- UniqueExpenseList +UniqueTagList -[hidden]down- UniqueExpenseList UniqueTagList *-right-> "*" Tag -UniquePersonList o-right-> Person +UniqueExpenseList o-right-> Expense -Person -up-> "*" Tag +Expense -up-> "1" Tag -Person *--> Name -Person *--> Phone -Person *--> Email -Person *--> Address +Expense *--> Description +Expense *--> Amount +Expense *--> Date +Expense *--> Remark @enduml diff --git a/docs/diagrams/CategoryBudgetActivityDiagram.puml b/docs/diagrams/CategoryBudgetActivityDiagram.puml new file mode 100644 index 00000000000..11f3deb7350 --- /dev/null +++ b/docs/diagrams/CategoryBudgetActivityDiagram.puml @@ -0,0 +1,16 @@ +@startuml +(*) --> "user requests to add expense with a specified category" +If "" then +--> [category exists] "add expense and update budget balance" +else +--> [else] "re-tag expense with default tag" +--> "add expense and update budget balance" +Endif +If "" then +--> [user accepts] (*) +else +--> [else] "user creates specified category" +--> "user edits expense to desired category" +Endif +-->(*) +@enduml diff --git a/docs/diagrams/CategoryBudgetActivityDiagram2.puml b/docs/diagrams/CategoryBudgetActivityDiagram2.puml new file mode 100644 index 00000000000..281751c9a2f --- /dev/null +++ b/docs/diagrams/CategoryBudgetActivityDiagram2.puml @@ -0,0 +1,22 @@ +@startuml +(*) --> "user requests to top-up a specified category-budget" +If "" then +--> [category exists] "top-up specified category-budget" +--> "run command" +If "" then +--> [user tops-up too much] "user requests to reduce category-budget" +If "" then +--> [amount reduced exceeds amount present in budget] "reduce category-budget to zero" +-->(*) +else +--> [else] "reduce category-budget by specified amount" +-->(*) +Endif +else +--> [else] (*) +Endif +else +--> [else] "Bamboo shows error message" +Endif +-->(*) +@enduml diff --git a/docs/diagrams/CommitActivityDiagram.puml b/docs/diagrams/CommitActivityDiagram.puml deleted file mode 100644 index 7f8fe407f89..00000000000 --- a/docs/diagrams/CommitActivityDiagram.puml +++ /dev/null @@ -1,15 +0,0 @@ -@startuml -start -:User executes command; - -'Since the beta syntax does not support placing the condition outside the -'diamond we place it as the true branch instead. - -if () then ([command commits AddressBook]) - :Purge redunant states; - :Save AddressBook to - addressBookStateList; -else ([else]) -endif -stop -@enduml diff --git a/docs/diagrams/DefaultAliasSequenceDiagram.puml b/docs/diagrams/DefaultAliasSequenceDiagram.puml new file mode 100644 index 00000000000..59107d8dde1 --- /dev/null +++ b/docs/diagrams/DefaultAliasSequenceDiagram.puml @@ -0,0 +1,35 @@ +@startuml +!include style.puml + +box Logic LOGIC_COLOR_T1 +participant ":LogicManager" as LogicManager LOGIC_COLOR +participant ":ExpenseBookParser" as ExpenseBookParser LOGIC_COLOR +participant "s:DefaultAliasCommand" as DefaultAliasCommand LOGIC_COLOR +end box + +[-> LogicManager : execute(defaultalias) +activate LogicManager + +LogicManager -> ExpenseBookParser : parseCommand(defaultalias) +activate ExpenseBookParser + +create DefaultAliasCommand +ExpenseBookParser -> DefaultAliasCommand +activate DefaultAliasCommand + +DefaultAliasCommand --> ExpenseBookParser +deactivate DefaultAliasCommand + +ExpenseBookParser --> LogicManager : s +deactivate ExpenseBookParser + +LogicManager -> DefaultAliasCommand : execute() +activate DefaultAliasCommand + +deactivate DefaultAliasCommand +DefaultAliasCommand -[hidden]-> LogicManager : result +destroy DefaultAliasCommand + +[<--LogicManager +deactivate LogicManager +@enduml diff --git a/docs/diagrams/DeleteSequenceDiagram.puml b/docs/diagrams/DeleteSequenceDiagram.puml index 1dc2311b245..7c13449fca7 100644 --- a/docs/diagrams/DeleteSequenceDiagram.puml +++ b/docs/diagrams/DeleteSequenceDiagram.puml @@ -3,7 +3,7 @@ box Logic LOGIC_COLOR_T1 participant ":LogicManager" as LogicManager LOGIC_COLOR -participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR +participant ":ExpenseBookParser" as ExpenseBookParser LOGIC_COLOR participant ":DeleteCommandParser" as DeleteCommandParser LOGIC_COLOR participant "d:DeleteCommand" as DeleteCommand LOGIC_COLOR participant ":CommandResult" as CommandResult LOGIC_COLOR @@ -16,17 +16,17 @@ end box [-> LogicManager : execute("delete 1") activate LogicManager -LogicManager -> AddressBookParser : parseCommand("delete 1") -activate AddressBookParser +LogicManager -> ExpenseBookParser : parseCommand("delete 1") +activate ExpenseBookParser create DeleteCommandParser -AddressBookParser -> DeleteCommandParser +ExpenseBookParser -> DeleteCommandParser activate DeleteCommandParser -DeleteCommandParser --> AddressBookParser +DeleteCommandParser --> ExpenseBookParser deactivate DeleteCommandParser -AddressBookParser -> DeleteCommandParser : parse("1") +ExpenseBookParser -> DeleteCommandParser : parse("1") activate DeleteCommandParser create DeleteCommand @@ -36,19 +36,19 @@ activate DeleteCommand DeleteCommand --> DeleteCommandParser : d deactivate DeleteCommand -DeleteCommandParser --> AddressBookParser : d +DeleteCommandParser --> ExpenseBookParser : d deactivate DeleteCommandParser 'Hidden arrow to position the destroy marker below the end of the activation bar. -DeleteCommandParser -[hidden]-> AddressBookParser +DeleteCommandParser -[hidden]-> ExpenseBookParser destroy DeleteCommandParser -AddressBookParser --> LogicManager : d -deactivate AddressBookParser +ExpenseBookParser --> LogicManager : d +deactivate ExpenseBookParser LogicManager -> DeleteCommand : execute() activate DeleteCommand -DeleteCommand -> Model : deletePerson(1) +DeleteCommand -> Model : deleteExpense(1) activate Model Model --> DeleteCommand diff --git a/docs/diagrams/GraphicalRepresentationActivityDiagram.puml b/docs/diagrams/GraphicalRepresentationActivityDiagram.puml new file mode 100644 index 00000000000..63d99b46e55 --- /dev/null +++ b/docs/diagrams/GraphicalRepresentationActivityDiagram.puml @@ -0,0 +1,19 @@ + @startuml + (*) --> "Enter graph command" + ---> "Parse command" + if "" then + --> [valid] Execute graph command + --> Retrieve data + if "" then + --> [empty list] Display default message + --> (*) + else + --> [else] Display formatted graph + -->(*) + endif + else + --> [else] Throw exception + endif + --> (*) + + @enduml diff --git a/docs/diagrams/GraphicalRepresentationClassDiagram.puml b/docs/diagrams/GraphicalRepresentationClassDiagram.puml new file mode 100644 index 00000000000..3abbdedc39d --- /dev/null +++ b/docs/diagrams/GraphicalRepresentationClassDiagram.puml @@ -0,0 +1,24 @@ +@startuml +!include style.puml +skinparam arrowThickness 1.1 +skinparam arrowColor MODEL_COLOR +skinparam classBackgroundColor MODEL_COLOR + +class ExpenseBook +class UniqueExpenseList +class ObservableList +class Expense +class PieChartData +interface ChartDataCollector <> +class GraphicalDisplayWindow UI_COLOR + +hide empty members + +ExpenseBook --> UniqueExpenseList +UniqueExpenseList *--> ObservableList +ObservableList --> Expense +ChartDataCollector <|.. PieChartData +PieChartData --> ExpenseBook +GraphicalDisplayWindow -[UI_COLOR]-> ChartDataCollector + +@enduml diff --git a/docs/diagrams/GraphicalRepresentationSequenceDiagram.puml b/docs/diagrams/GraphicalRepresentationSequenceDiagram.puml new file mode 100644 index 00000000000..a9a195ce7c4 --- /dev/null +++ b/docs/diagrams/GraphicalRepresentationSequenceDiagram.puml @@ -0,0 +1,15 @@ +@startuml + +-> PieChartData : getChartData() +activate PieChartData +loop size of list + PieChartData -> ObservableList : collectData() + activate ObservableList + ObservableList -> Expense + activate Expense + Expense -> ObservableList + ObservableList -> PieChartData +end +<- PieChartData +deactivate PieChartData +@enduml diff --git a/docs/diagrams/LogicClassDiagram.puml b/docs/diagrams/LogicClassDiagram.puml index 016ef33e2e2..7c1cba86067 100644 --- a/docs/diagrams/LogicClassDiagram.puml +++ b/docs/diagrams/LogicClassDiagram.puml @@ -8,7 +8,7 @@ package Logic { package Parser { Interface Parser <> -Class AddressBookParser +Class ExpenseBookParser Class XYZCommandParser Class CliSyntax Class ParserUtil @@ -35,8 +35,8 @@ Class HiddenOutside #FFFFFF HiddenOutside ..> Logic LogicManager .up.|> Logic -LogicManager -->"1" AddressBookParser -AddressBookParser .left.> XYZCommandParser: creates > +LogicManager -->"1" ExpenseBookParser +ExpenseBookParser .left.> XYZCommandParser: creates > XYZCommandParser ..> XYZCommand : creates > XYZCommandParser ..|> Parser diff --git a/docs/diagrams/ModelClassDiagram.puml b/docs/diagrams/ModelClassDiagram.puml index e85a00d4107..abdf613307c 100644 --- a/docs/diagrams/ModelClassDiagram.puml +++ b/docs/diagrams/ModelClassDiagram.puml @@ -5,52 +5,89 @@ skinparam arrowColor MODEL_COLOR skinparam classBackgroundColor MODEL_COLOR Package Model <>{ -Interface ReadOnlyAddressBook <> +Interface ReadOnlyExpenseBook <> Interface Model <> Interface ObservableList <> -Class AddressBook -Class ReadOnlyAddressBook +Class ExpenseBook +Class ReadOnlyExpenseBook Class Model Class ModelManager Class UserPrefs Class ReadOnlyUserPrefs -Package Person { -Class Person -Class Address -Class Email -Class Name -Class Phone -Class UniquePersonList +Package Expense { +Class Expense +Class Date +Class Description +Class UniqueExpenseList +Class Amount +Class Remark } Package Tag { +Class UniqueTagList Class Tag } + +Package Budget { +Interface Budget <> +Class UniqueCategoryBudgetList +Class CategoryBudget +Class Amount +} + +Package Tag { +Class Tag +} + +Package Alias { +Class AliasMap +} } Class HiddenOutside #FFFFFF HiddenOutside ..> Model -AddressBook .up.|> ReadOnlyAddressBook +ExpenseBook .up.|> ReadOnlyExpenseBook ModelManager .up.|> Model Model .right.> ObservableList -ModelManager o--> "1" AddressBook +ModelManager o--> "1" ExpenseBook +ModelManager o-right-> "1" AliasMap ModelManager o-left-> "1" UserPrefs UserPrefs .up.|> ReadOnlyUserPrefs -AddressBook *--> "1" UniquePersonList -UniquePersonList o--> "*" Person -Person *--> Name -Person *--> Phone -Person *--> Email -Person *--> Address -Person *--> "*" Tag +ExpenseBook *--> "1" UniqueExpenseList +UniqueExpenseList o--> "*" Expense +Expense *--> "1" Description +Expense *-right-> "1" Amount +Expense *--> "1" Date +Expense *--> "1" Tag +Expense --> "0..1" Remark + +ExpenseBook *--> "1" UniqueCategoryBudgetList +UniqueCategoryBudgetList o--> "*" CategoryBudget : budgets +CategoryBudget *--> Amount +CategoryBudget *--> "1" Tag +Budget ^.right. UniqueCategoryBudgetList +Budget ^.. CategoryBudget + +ExpenseBook *--> "1" AliasMap + +ExpenseBook *--> "1" UniqueTagList +UniqueTagList o--> "*" Tag + +Class HiddenOutside2 #FFFFFF +HiddenOutside2 -[hidden]-> Amount +Tag -[hidden]left-> HiddenOutside2 -Name -[hidden]right-> Phone -Phone -[hidden]right-> Address -Address -[hidden]right-> Email +Description -[hidden]right-> Amount +Amount -[hidden]left-> CategoryBudget +Amount -[hidden]-> Tag +Tag -[hidden]right-> Date -ModelManager -->"1" Person : filtered list +UniqueExpenseList --> "1" Expense : filtered list +UniqueCategoryBudgetList o-down-> "1" CategoryBudget : "Default" +UniqueCategoryBudgetList ..> Tag +UniqueCategoryBudgetList ..> Amount @enduml diff --git a/docs/diagrams/SortSequenceDiagram1.puml b/docs/diagrams/SortSequenceDiagram1.puml new file mode 100644 index 00000000000..4bab4bc68aa --- /dev/null +++ b/docs/diagrams/SortSequenceDiagram1.puml @@ -0,0 +1,62 @@ +@startuml +!include style.puml + +box Logic LOGIC_COLOR_T1 +participant ":LogicManager" as LogicManager LOGIC_COLOR +participant ":ExpenseBookParser" as ExpenseBookParser LOGIC_COLOR +participant ":SortCommandParser" as SortCommandParser LOGIC_COLOR +participant "cmp:SortKeyComparator" as SortKeyComparator LOGIC_COLOR +participant "s:SortCommand" as SortCommand LOGIC_COLOR +end box + +box Model MODEL_COLOR_T1 +participant ":Model" as Model MODEL_COLOR +end box +[-> LogicManager : execute("sort -by date") +activate LogicManager + +LogicManager -> ExpenseBookParser : parseCommand("sort -by date") +activate ExpenseBookParser + +ExpenseBookParser -> SortCommandParser : parse(" -by date") +activate SortCommandParser + +create SortKeyComparator +SortCommandParser -> SortKeyComparator +activate SortKeyComparator + +SortKeyComparator --> SortCommandParser +deactivate SortKeyComparator + +create SortCommand +SortCommandParser -> SortCommand +activate SortCommand + +SortCommand --> SortCommandParser +deactivate SortCommand + +SortCommandParser --> ExpenseBookParser +deactivate SortCommandParser + +ExpenseBookParser --> LogicManager : s +deactivate ExpenseBookParser + +LogicManager -> SortCommand : execute() +activate SortCommand + +SortCommand -> Model : sortExpenseList(cmp) +activate Model + + +Model --> SortCommand +deactivate Model + +SortCommand --> LogicManager : result +deactivate SortCommand +SortCommand -[hidden]-> LogicManager : result +destroy SortCommand +destroy SortKeyComparator + +[<--LogicManager +deactivate LogicManager +@enduml diff --git a/docs/diagrams/SortSequenceDiagram2.puml b/docs/diagrams/SortSequenceDiagram2.puml new file mode 100644 index 00000000000..848651c9cc1 --- /dev/null +++ b/docs/diagrams/SortSequenceDiagram2.puml @@ -0,0 +1,29 @@ +@startuml +!include style.puml + + +box Model MODEL_COLOR_T1 +participant ":Model" as Model MODEL_COLOR +participant ":ExpenseBook" as ExpenseBook MODEL_COLOR +participant ":UniqueExpenseList" as UniqueExpenseList MODEL_COLOR +end box + +[-> Model : sortExpenseList(cmp) +activate Model + +Model -> ExpenseBook : sortExpenses(cmp) +activate ExpenseBook + +ExpenseBook -> UniqueExpenseList : sortExpenses(cmp) +activate UniqueExpenseList + +UniqueExpenseList --> ExpenseBook +deactivate UniqueExpenseList + +ExpenseBook --> Model +deactivate ExpenseBook + +[<-- Model +deactivate Model + +@enduml diff --git a/docs/diagrams/StorageClassDiagram.puml b/docs/diagrams/StorageClassDiagram.puml index 6adb2e156bf..bfbfad134ae 100644 --- a/docs/diagrams/StorageClassDiagram.puml +++ b/docs/diagrams/StorageClassDiagram.puml @@ -6,19 +6,24 @@ skinparam classBackgroundColor STORAGE_COLOR Interface Storage <> Interface UserPrefsStorage <> -Interface AddressBookStorage <> +Interface ExpenseBookStorage <> Class StorageManager Class JsonUserPrefsStorage -Class JsonAddressBookStorage +Class JsonExpenseBookStorage StorageManager .left.|> Storage StorageManager o-right-> UserPrefsStorage -StorageManager o--> AddressBookStorage +StorageManager o--> ExpenseBookStorage JsonUserPrefsStorage .left.|> UserPrefsStorage -JsonAddressBookStorage .left.|> AddressBookStorage -JsonAddressBookStorage .down.> JsonSerializableAddressBookStorage -JsonSerializableAddressBookStorage .right.> JsonSerializablePerson -JsonSerializablePerson .right.> JsonAdaptedTag +JsonExpenseBookStorage .left.|> ExpenseBookStorage +JsonExpenseBookStorage .down.> JsonSerializableExpenseBook +JsonSerializableExpenseBook -right-> JsonSerializableExpense +JsonSerializableExpenseBook -down-> "*" JsonAdaptedTag +JsonSerializableExpense -right-> "1" JsonAdaptedTag +JsonSerializableExpenseBook -down-> JsonAdaptedBudgetList +JsonAdaptedBudgetList -right-> "1" JsonAdaptedBudget +JsonAdaptedBudgetList -down-> "*" JsonAdaptedBudget +JsonAdaptedBudget -right-> "1" JsonAdaptedTag @enduml diff --git a/docs/diagrams/SwitchSequenceDiagram.puml b/docs/diagrams/SwitchSequenceDiagram.puml new file mode 100644 index 00000000000..35c1fd8256c --- /dev/null +++ b/docs/diagrams/SwitchSequenceDiagram.puml @@ -0,0 +1,61 @@ +@startuml +!include style.puml + +box Logic LOGIC_COLOR_T1 +participant ":LogicManager" as LogicManager LOGIC_COLOR +participant ":ExpenseBookParser" as ExpenseBookParser LOGIC_COLOR +participant "s:SwitchCommand" as SwitchCommand LOGIC_COLOR +end box + +box Model MODEL_COLOR_T1 +participant ":Model" as Model MODEL_COLOR +end box +[-> LogicManager : execute(switch) +activate LogicManager + +LogicManager -> ExpenseBookParser : parseCommand(switch) +activate ExpenseBookParser + +create SwitchCommand +ExpenseBookParser -> SwitchCommand +activate SwitchCommand + +SwitchCommand --> ExpenseBookParser +deactivate SwitchCommand + +ExpenseBookParser --> LogicManager : s +deactivate ExpenseBookParser + +LogicManager -> SwitchCommand : execute() +activate SwitchCommand + +SwitchCommand -> Model : hasCategory(category) +activate Model + +ref over Model : hasCategory + +Model -> SwitchCommand : hasCategory +deactivate Model + +SwitchCommand -> Model : switchCategory(category) +activate Model + +Model -> Model : updateExpenseBookCategory(category) +activate Model + +ref over Model : update lists + +Model -> Model +deactivate Model + +Model --> SwitchCommand +deactivate Model + +SwitchCommand --> LogicManager : result +deactivate SwitchCommand +SwitchCommand -[hidden]-> LogicManager : result +destroy SwitchCommand + +[<--LogicManager +deactivate LogicManager +@enduml diff --git a/docs/diagrams/SwitchSequenceDiagram2.puml b/docs/diagrams/SwitchSequenceDiagram2.puml new file mode 100644 index 00000000000..ba89fab848b --- /dev/null +++ b/docs/diagrams/SwitchSequenceDiagram2.puml @@ -0,0 +1,28 @@ +@startuml +!include style.puml + +mainframe sd hasCategory + +box Model MODEL_COLOR_T1 +participant ":Model" as Model MODEL_COLOR +participant ":ExpenseBook" as ExpenseBook MODEL_COLOR +participant ":UniqueTagList" as UniqueTagList MODEL_COLOR +end box +[-> Model : hasCategory(category) +activate Model + +Model -> ExpenseBook: containsCategory(toCheck) +activate ExpenseBook + +ExpenseBook -> UniqueTagList:contains(toCheck) +activate UniqueTagList + +UniqueTagList -> ExpenseBook : contains result +deactivate UniqueTagList + +ExpenseBook -> Model : containsCategory result +deactivate ExpenseBook + +[<--Model : hasCategory result +deactivate Model +@enduml diff --git a/docs/diagrams/SwitchSequenceDiagram3.puml b/docs/diagrams/SwitchSequenceDiagram3.puml new file mode 100644 index 00000000000..ac4a70c6253 --- /dev/null +++ b/docs/diagrams/SwitchSequenceDiagram3.puml @@ -0,0 +1,49 @@ +@startuml +!include style.puml +mainframe sd update lists + +box Model MODEL_COLOR_T1 +participant ":Model" as Model MODEL_COLOR +participant ":ExpenseBook" as ExpenseBook MODEL_COLOR +participant ":UniqueCategoryBudgetList" as UniqueCategoryBudgetList MODEL_COLOR +participant ":UniqueExpenseList" as UniqueExpenseList MODEL_COLOR +end box +[-> Model : updateExpenseBookCategory(category) +activate Model + +Model -> Model : updateFilteredBudgetList(predicate) +activate Model + +Model -> ExpenseBook : updateFilteredBudgets(predicate) +activate ExpenseBook + +ExpenseBook -> UniqueCategoryBudgetList : filterCategoryBudget(predicate) +activate UniqueCategoryBudgetList + +UniqueCategoryBudgetList -> ExpenseBook +deactivate UniqueCategoryBudgetList + +ExpenseBook -> Model +deactivate ExpenseBook + +Model -> Model +deactivate Model + +Model -> Model : updateFilteredExpenseList(predicate) +activate Model + +Model -> ExpenseBook : updateFilteredExpenses(predicate) +activate ExpenseBook + +ExpenseBook -> UniqueExpenseList : filterExpenses(predicate) +activate UniqueExpenseList + +UniqueExpenseList -> ExpenseBook +deactivate UniqueExpenseList + +ExpenseBook -> Model +deactivate ExpenseBook + +[<--Model +deactivate Model +@enduml diff --git a/docs/diagrams/UiClassDiagram.puml b/docs/diagrams/UiClassDiagram.puml index 92746f9fcf7..d0f8f295506 100644 --- a/docs/diagrams/UiClassDiagram.puml +++ b/docs/diagrams/UiClassDiagram.puml @@ -11,8 +11,9 @@ Class UiManager Class MainWindow Class HelpWindow Class ResultDisplay -Class PersonListPanel -Class PersonCard +Class BudgetDisplay +Class ExpenseListPanel +Class ExpenseCard Class StatusBarFooter Class CommandBox } @@ -33,25 +34,28 @@ UiManager -down-> MainWindow MainWindow --> HelpWindow MainWindow *-down-> CommandBox MainWindow *-down-> ResultDisplay -MainWindow *-down-> PersonListPanel +MainWindow *-down-> BudgetDisplay +MainWindow *-down-> ExpenseListPanel MainWindow *-down-> StatusBarFooter -PersonListPanel -down-> PersonCard +ExpenseListPanel -down-> ExpenseCard MainWindow -left-|> UiPart ResultDisplay --|> UiPart +BudgetDisplay --|> UiPart CommandBox --|> UiPart -PersonListPanel --|> UiPart -PersonCard --|> UiPart +ExpenseListPanel --|> UiPart +ExpenseCard --|> UiPart StatusBarFooter --|> UiPart HelpWindow -down-|> UiPart -PersonCard ..> Model +ExpenseCard ..> Model +BudgetDisplay ..> Model UiManager -right-> Logic MainWindow -left-> Logic -PersonListPanel -[hidden]left- HelpWindow +ExpenseListPanel -[hidden]left- HelpWindow HelpWindow -[hidden]left- CommandBox CommandBox -[hidden]left- ResultDisplay ResultDisplay -[hidden]left- StatusBarFooter diff --git a/docs/diagrams/UndoRedoState0.puml b/docs/diagrams/UndoRedoState0.puml deleted file mode 100644 index 96e30744d24..00000000000 --- a/docs/diagrams/UndoRedoState0.puml +++ /dev/null @@ -1,20 +0,0 @@ -@startuml -!include style.puml -skinparam ClassFontColor #000000 -skinparam ClassBorderColor #000000 - -title Initial state - -package States { - class State1 as "__ab0:AddressBook__" - class State2 as "__ab1:AddressBook__" - class State3 as "__ab2:AddressBook__" -} -State1 -[hidden]right-> State2 -State2 -[hidden]right-> State3 -hide State2 -hide State3 - -class Pointer as "Current State" #FFFFF -Pointer -up-> State1 -@end diff --git a/docs/diagrams/UndoRedoState1.puml b/docs/diagrams/UndoRedoState1.puml deleted file mode 100644 index 01fcb9b2b96..00000000000 --- a/docs/diagrams/UndoRedoState1.puml +++ /dev/null @@ -1,22 +0,0 @@ -@startuml -!include style.puml -skinparam ClassFontColor #000000 -skinparam ClassBorderColor #000000 - -title After command "delete 5" - -package States <> { - class State1 as "__ab0:AddressBook__" - class State2 as "__ab1:AddressBook__" - class State3 as "__ab2:AddressBook__" -} - -State1 -[hidden]right-> State2 -State2 -[hidden]right-> State3 - -hide State3 - -class Pointer as "Current State" #FFFFF - -Pointer -up-> State2 -@end diff --git a/docs/diagrams/UndoRedoState2.puml b/docs/diagrams/UndoRedoState2.puml deleted file mode 100644 index bccc230a5d1..00000000000 --- a/docs/diagrams/UndoRedoState2.puml +++ /dev/null @@ -1,20 +0,0 @@ -@startuml -!include style.puml -skinparam ClassFontColor #000000 -skinparam ClassBorderColor #000000 - -title After command "add n/David" - -package States <> { - class State1 as "__ab0:AddressBook__" - class State2 as "__ab1:AddressBook__" - class State3 as "__ab2:AddressBook__" -} - -State1 -[hidden]right-> State2 -State2 -[hidden]right-> State3 - -class Pointer as "Current State" #FFFFF - -Pointer -up-> State3 -@end diff --git a/docs/diagrams/UndoRedoState3.puml b/docs/diagrams/UndoRedoState3.puml deleted file mode 100644 index ea29c9483e4..00000000000 --- a/docs/diagrams/UndoRedoState3.puml +++ /dev/null @@ -1,20 +0,0 @@ -@startuml -!include style.puml -skinparam ClassFontColor #000000 -skinparam ClassBorderColor #000000 - -title After command "undo" - -package States <> { - class State1 as "__ab0:AddressBook__" - class State2 as "__ab1:AddressBook__" - class State3 as "__ab2:AddressBook__" -} - -State1 -[hidden]right-> State2 -State2 -[hidden]right-> State3 - -class Pointer as "Current State" #FFFFF - -Pointer -up-> State2 -@end diff --git a/docs/diagrams/UndoRedoState4.puml b/docs/diagrams/UndoRedoState4.puml deleted file mode 100644 index 1b784cece80..00000000000 --- a/docs/diagrams/UndoRedoState4.puml +++ /dev/null @@ -1,20 +0,0 @@ -@startuml -!include style.puml -skinparam ClassFontColor #000000 -skinparam ClassBorderColor #000000 - -title After command "list" - -package States <> { - class State1 as "__ab0:AddressBook__" - class State2 as "__ab1:AddressBook__" - class State3 as "__ab2:AddressBook__" -} - -State1 -[hidden]right-> State2 -State2 -[hidden]right-> State3 - -class Pointer as "Current State" #FFFFF - -Pointer -up-> State2 -@end diff --git a/docs/diagrams/UndoRedoState5.puml b/docs/diagrams/UndoRedoState5.puml deleted file mode 100644 index 88927be32bc..00000000000 --- a/docs/diagrams/UndoRedoState5.puml +++ /dev/null @@ -1,21 +0,0 @@ -@startuml -!include style.puml -skinparam ClassFontColor #000000 -skinparam ClassBorderColor #000000 - -title After command "clear" - -package States <> { - class State1 as "__ab0:AddressBook__" - class State2 as "__ab1:AddressBook__" - class State3 as "__ab3:AddressBook__" -} - -State1 -[hidden]right-> State2 -State2 -[hidden]right-> State3 - -class Pointer as "Current State" #FFFFF - -Pointer -up-> State3 -note right on link: State ab2 deleted. -@end diff --git a/docs/diagrams/UndoSequenceDiagram.puml b/docs/diagrams/UndoSequenceDiagram.puml deleted file mode 100644 index 410aab4e412..00000000000 --- a/docs/diagrams/UndoSequenceDiagram.puml +++ /dev/null @@ -1,53 +0,0 @@ -@startuml -!include style.puml - -box Logic LOGIC_COLOR_T1 -participant ":LogicManager" as LogicManager LOGIC_COLOR -participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR -participant "u:UndoCommand" as UndoCommand LOGIC_COLOR -end box - -box Model MODEL_COLOR_T1 -participant ":Model" as Model MODEL_COLOR -participant ":VersionedAddressBook" as VersionedAddressBook MODEL_COLOR -end box -[-> LogicManager : execute(undo) -activate LogicManager - -LogicManager -> AddressBookParser : parseCommand(undo) -activate AddressBookParser - -create UndoCommand -AddressBookParser -> UndoCommand -activate UndoCommand - -UndoCommand --> AddressBookParser -deactivate UndoCommand - -AddressBookParser --> LogicManager : u -deactivate AddressBookParser - -LogicManager -> UndoCommand : execute() -activate UndoCommand - -UndoCommand -> Model : undoAddressBook() -activate Model - -Model -> VersionedAddressBook : undo() -activate VersionedAddressBook - -VersionedAddressBook -> VersionedAddressBook :resetData(ReadOnlyAddressBook) -VersionedAddressBook --> Model : -deactivate VersionedAddressBook - -Model --> UndoCommand -deactivate Model - -UndoCommand --> LogicManager : result -deactivate UndoCommand -UndoCommand -[hidden]-> LogicManager : result -destroy UndoCommand - -[<--LogicManager -deactivate LogicManager -@enduml diff --git a/docs/diagrams/tracing/LogicSequenceDiagram.puml b/docs/diagrams/tracing/LogicSequenceDiagram.puml index fdcbe1c0ccc..0bf64b9d4b0 100644 --- a/docs/diagrams/tracing/LogicSequenceDiagram.puml +++ b/docs/diagrams/tracing/LogicSequenceDiagram.puml @@ -2,7 +2,7 @@ !include ../style.puml Participant ":LogicManager" as logic LOGIC_COLOR -Participant ":AddressBookParser" as abp LOGIC_COLOR +Participant ":ExpenseBookParser" as abp LOGIC_COLOR Participant ":EditCommandParser" as ecp LOGIC_COLOR Participant "command:EditCommand" as ec LOGIC_COLOR @@ -13,7 +13,7 @@ create ecp abp -> ecp abp -> ecp ++: parse(arguments) create ec -ecp -> ec ++: index, editPersonDescriptor +ecp -> ec ++: index, editExpenseDescriptor ec --> ecp -- ecp --> abp --: command abp --> logic --: command diff --git a/docs/images/AliasSequenceDiagram.png b/docs/images/AliasSequenceDiagram.png new file mode 100644 index 00000000000..c713670bd86 Binary files /dev/null and b/docs/images/AliasSequenceDiagram.png differ diff --git a/docs/images/ArchitectureSequenceDiagram.png b/docs/images/ArchitectureSequenceDiagram.png index 2f1346869d0..d3751a596b9 100644 Binary files a/docs/images/ArchitectureSequenceDiagram.png and b/docs/images/ArchitectureSequenceDiagram.png differ diff --git a/docs/images/BetterModelClassDiagram.png b/docs/images/BetterModelClassDiagram.png index bc7ed18ae29..2da7b82a190 100644 Binary files a/docs/images/BetterModelClassDiagram.png and b/docs/images/BetterModelClassDiagram.png differ diff --git a/docs/images/CategoryBudgetActivityDiagram.png b/docs/images/CategoryBudgetActivityDiagram.png new file mode 100644 index 00000000000..01585e1344e Binary files /dev/null and b/docs/images/CategoryBudgetActivityDiagram.png differ diff --git a/docs/images/CategoryBudgetActivityDiagram2.png b/docs/images/CategoryBudgetActivityDiagram2.png new file mode 100644 index 00000000000..58aed73d039 Binary files /dev/null and b/docs/images/CategoryBudgetActivityDiagram2.png differ diff --git a/docs/images/CommitActivityDiagram.png b/docs/images/CommitActivityDiagram.png deleted file mode 100644 index 4de4fa4bf2b..00000000000 Binary files a/docs/images/CommitActivityDiagram.png and /dev/null differ diff --git a/docs/images/DefaultAliasSequenceDiagram.png b/docs/images/DefaultAliasSequenceDiagram.png new file mode 100644 index 00000000000..b9faa51b6d3 Binary files /dev/null and b/docs/images/DefaultAliasSequenceDiagram.png differ diff --git a/docs/images/DeleteSequenceDiagram.png b/docs/images/DeleteSequenceDiagram.png index fa327b39618..c75bbdce23b 100644 Binary files a/docs/images/DeleteSequenceDiagram.png and b/docs/images/DeleteSequenceDiagram.png differ diff --git a/docs/images/GraphicalRepresentationActivityDiagram.png b/docs/images/GraphicalRepresentationActivityDiagram.png new file mode 100644 index 00000000000..3d87c0e0390 Binary files /dev/null and b/docs/images/GraphicalRepresentationActivityDiagram.png differ diff --git a/docs/images/GraphicalRepresentationClassDiagram.png b/docs/images/GraphicalRepresentationClassDiagram.png new file mode 100644 index 00000000000..560bfb9a552 Binary files /dev/null and b/docs/images/GraphicalRepresentationClassDiagram.png differ diff --git a/docs/images/GraphicalRepresentationSequenceDiagram.png b/docs/images/GraphicalRepresentationSequenceDiagram.png new file mode 100644 index 00000000000..ceb06b7eb19 Binary files /dev/null and b/docs/images/GraphicalRepresentationSequenceDiagram.png differ diff --git a/docs/images/LogicClassDiagram.png b/docs/images/LogicClassDiagram.png index b9e853cef12..26bea56a968 100644 Binary files a/docs/images/LogicClassDiagram.png and b/docs/images/LogicClassDiagram.png differ diff --git a/docs/images/ModelClassDiagram.png b/docs/images/ModelClassDiagram.png index 280064118cf..b3e31ec4299 100644 Binary files a/docs/images/ModelClassDiagram.png and b/docs/images/ModelClassDiagram.png differ diff --git a/docs/images/SortSequenceDiagram1.png b/docs/images/SortSequenceDiagram1.png new file mode 100644 index 00000000000..902aa8bd5d9 Binary files /dev/null and b/docs/images/SortSequenceDiagram1.png differ diff --git a/docs/images/SortSequenceDiagram2.png b/docs/images/SortSequenceDiagram2.png new file mode 100644 index 00000000000..056936668e6 Binary files /dev/null and b/docs/images/SortSequenceDiagram2.png differ diff --git a/docs/images/StorageClassDiagram.png b/docs/images/StorageClassDiagram.png index d87c1216820..2e158c0b3bf 100644 Binary files a/docs/images/StorageClassDiagram.png and b/docs/images/StorageClassDiagram.png differ diff --git a/docs/images/SwitchSequenceDiagram.png b/docs/images/SwitchSequenceDiagram.png new file mode 100644 index 00000000000..b8ea025696a Binary files /dev/null and b/docs/images/SwitchSequenceDiagram.png differ diff --git a/docs/images/SwitchSequenceDiagram2.png b/docs/images/SwitchSequenceDiagram2.png new file mode 100644 index 00000000000..2aed295f9e3 Binary files /dev/null and b/docs/images/SwitchSequenceDiagram2.png differ diff --git a/docs/images/SwitchSequenceDiagram3.png b/docs/images/SwitchSequenceDiagram3.png new file mode 100644 index 00000000000..b0ec9f36baf Binary files /dev/null and b/docs/images/SwitchSequenceDiagram3.png differ diff --git a/docs/images/Ui.png b/docs/images/Ui.png index 5bd77847aa2..5bd796c7d36 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 7b4b3dbea45..057767ed275 100644 Binary files a/docs/images/UiClassDiagram.png and b/docs/images/UiClassDiagram.png differ diff --git a/docs/images/UndoRedoState0.png b/docs/images/UndoRedoState0.png deleted file mode 100644 index 8f7538cd884..00000000000 Binary files a/docs/images/UndoRedoState0.png and /dev/null differ diff --git a/docs/images/UndoRedoState1.png b/docs/images/UndoRedoState1.png deleted file mode 100644 index df9908d0948..00000000000 Binary files a/docs/images/UndoRedoState1.png and /dev/null differ diff --git a/docs/images/UndoRedoState2.png b/docs/images/UndoRedoState2.png deleted file mode 100644 index 36519c1015b..00000000000 Binary files a/docs/images/UndoRedoState2.png and /dev/null differ diff --git a/docs/images/UndoRedoState3.png b/docs/images/UndoRedoState3.png deleted file mode 100644 index 19959d01712..00000000000 Binary files a/docs/images/UndoRedoState3.png and /dev/null differ diff --git a/docs/images/UndoRedoState4.png b/docs/images/UndoRedoState4.png deleted file mode 100644 index 4c623e4f2c5..00000000000 Binary files a/docs/images/UndoRedoState4.png and /dev/null differ diff --git a/docs/images/UndoRedoState5.png b/docs/images/UndoRedoState5.png deleted file mode 100644 index 84ad2afa6bd..00000000000 Binary files a/docs/images/UndoRedoState5.png and /dev/null differ diff --git a/docs/images/UndoSequenceDiagram.png b/docs/images/UndoSequenceDiagram.png deleted file mode 100644 index 6addcd3a8d9..00000000000 Binary files a/docs/images/UndoSequenceDiagram.png and /dev/null differ diff --git a/docs/images/hakiem526.png b/docs/images/hakiem526.png new file mode 100644 index 00000000000..8228484dd09 Binary files /dev/null and b/docs/images/hakiem526.png differ diff --git a/docs/images/jaylenlee.png b/docs/images/jaylenlee.png new file mode 100644 index 00000000000..f74ab243f11 Binary files /dev/null and b/docs/images/jaylenlee.png differ diff --git a/docs/images/lebencwb.png b/docs/images/lebencwb.png new file mode 100644 index 00000000000..1221abb8536 Binary files /dev/null and b/docs/images/lebencwb.png differ diff --git a/docs/images/marcus2k.png b/docs/images/marcus2k.png new file mode 100644 index 00000000000..cee10b1c5f9 Binary files /dev/null and b/docs/images/marcus2k.png differ diff --git a/docs/images/maxxyh.png b/docs/images/maxxyh.png new file mode 100644 index 00000000000..c1bc915d9cd Binary files /dev/null and b/docs/images/maxxyh.png differ diff --git a/docs/images/ug_example/addCat_example.PNG b/docs/images/ug_example/addCat_example.PNG new file mode 100644 index 00000000000..d8eea0f3f11 Binary files /dev/null and b/docs/images/ug_example/addCat_example.PNG differ diff --git a/docs/images/ug_example/addCat_example_2.PNG b/docs/images/ug_example/addCat_example_2.PNG new file mode 100644 index 00000000000..39fc60e5dd8 Binary files /dev/null and b/docs/images/ug_example/addCat_example_2.PNG differ diff --git a/docs/images/ug_example/add_example.PNG b/docs/images/ug_example/add_example.PNG new file mode 100644 index 00000000000..9141e59db3e Binary files /dev/null and b/docs/images/ug_example/add_example.PNG differ diff --git a/docs/images/ug_example/alias_example.PNG b/docs/images/ug_example/alias_example.PNG new file mode 100644 index 00000000000..4f77a5ffff1 Binary files /dev/null and b/docs/images/ug_example/alias_example.PNG differ diff --git a/docs/images/ug_example/alias_example_2.PNG b/docs/images/ug_example/alias_example_2.PNG new file mode 100644 index 00000000000..c8fef37f900 Binary files /dev/null and b/docs/images/ug_example/alias_example_2.PNG differ diff --git a/docs/images/ug_example/alias_example_3.PNG b/docs/images/ug_example/alias_example_3.PNG new file mode 100644 index 00000000000..441ade51ad0 Binary files /dev/null and b/docs/images/ug_example/alias_example_3.PNG differ diff --git a/docs/images/ug_example/clear_example.png b/docs/images/ug_example/clear_example.png new file mode 100644 index 00000000000..8c6767d5c4c Binary files /dev/null and b/docs/images/ug_example/clear_example.png differ diff --git a/docs/images/ug_example/deleteCat_example.PNG b/docs/images/ug_example/deleteCat_example.PNG new file mode 100644 index 00000000000..83c639e2964 Binary files /dev/null and b/docs/images/ug_example/deleteCat_example.PNG differ diff --git a/docs/images/ug_example/delete_example.PNG b/docs/images/ug_example/delete_example.PNG new file mode 100644 index 00000000000..5390fe38722 Binary files /dev/null and b/docs/images/ug_example/delete_example.PNG differ diff --git a/docs/images/ug_example/edit_example.PNG b/docs/images/ug_example/edit_example.PNG new file mode 100644 index 00000000000..18f54198dda Binary files /dev/null and b/docs/images/ug_example/edit_example.PNG differ diff --git a/docs/images/ug_example/find_example.PNG b/docs/images/ug_example/find_example.PNG new file mode 100644 index 00000000000..2325aae2db4 Binary files /dev/null and b/docs/images/ug_example/find_example.PNG differ diff --git a/docs/images/ug_example/find_example_2.PNG b/docs/images/ug_example/find_example_2.PNG new file mode 100644 index 00000000000..e70395b4311 Binary files /dev/null and b/docs/images/ug_example/find_example_2.PNG differ diff --git a/docs/images/ug_example/graph_example.PNG b/docs/images/ug_example/graph_example.PNG new file mode 100644 index 00000000000..d7af20aa8d0 Binary files /dev/null and b/docs/images/ug_example/graph_example.PNG differ diff --git a/docs/images/ug_example/help_example.PNG b/docs/images/ug_example/help_example.PNG new file mode 100644 index 00000000000..3890a9552f4 Binary files /dev/null and b/docs/images/ug_example/help_example.PNG differ diff --git a/docs/images/ug_example/list_example.PNG b/docs/images/ug_example/list_example.PNG new file mode 100644 index 00000000000..4f492a199c9 Binary files /dev/null and b/docs/images/ug_example/list_example.PNG differ diff --git a/docs/images/ug_example/reduce_example.png b/docs/images/ug_example/reduce_example.png new file mode 100644 index 00000000000..adff5d25f47 Binary files /dev/null and b/docs/images/ug_example/reduce_example.png differ diff --git a/docs/images/ug_example/remark_example.PNG b/docs/images/ug_example/remark_example.PNG new file mode 100644 index 00000000000..450ff249823 Binary files /dev/null and b/docs/images/ug_example/remark_example.PNG differ diff --git a/docs/images/ug_example/resetAlias_example.PNG b/docs/images/ug_example/resetAlias_example.PNG new file mode 100644 index 00000000000..804cc8353cc Binary files /dev/null and b/docs/images/ug_example/resetAlias_example.PNG differ diff --git a/docs/images/ug_example/sort_example.PNG b/docs/images/ug_example/sort_example.PNG new file mode 100644 index 00000000000..fa5a08bbe56 Binary files /dev/null and b/docs/images/ug_example/sort_example.PNG differ diff --git a/docs/images/ug_example/sort_example_2.PNG b/docs/images/ug_example/sort_example_2.PNG new file mode 100644 index 00000000000..3e899b64dcd Binary files /dev/null and b/docs/images/ug_example/sort_example_2.PNG differ diff --git a/docs/images/ug_example/sort_example_3.PNG b/docs/images/ug_example/sort_example_3.PNG new file mode 100644 index 00000000000..806bf578773 Binary files /dev/null and b/docs/images/ug_example/sort_example_3.PNG differ diff --git a/docs/images/ug_example/sort_example_4.PNG b/docs/images/ug_example/sort_example_4.PNG new file mode 100644 index 00000000000..fa15014ee01 Binary files /dev/null and b/docs/images/ug_example/sort_example_4.PNG differ diff --git a/docs/images/ug_example/switch_example.PNG b/docs/images/ug_example/switch_example.PNG new file mode 100644 index 00000000000..6de250c404b Binary files /dev/null and b/docs/images/ug_example/switch_example.PNG differ diff --git a/docs/images/ug_example/topup_example.PNG b/docs/images/ug_example/topup_example.PNG new file mode 100644 index 00000000000..bc4d2fbba13 Binary files /dev/null and b/docs/images/ug_example/topup_example.PNG differ diff --git a/docs/index.md b/docs/index.md index 7601dbaad0d..bde0a88f2d3 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,17 +1,17 @@ --- layout: page -title: AddressBook Level-3 +title: Bamboo --- -[![CI Status](https://github.com/se-edu/addressbook-level3/workflows/Java%20CI/badge.svg)](https://github.com/se-edu/addressbook-level3/actions) -[![codecov](https://codecov.io/gh/se-edu/addressbook-level3/branch/master/graph/badge.svg)](https://codecov.io/gh/se-edu/addressbook-level3) +[![CI Status](https://github.com/AY2021S1-CS2103-W14-3/tp/workflows/Java%20CI/badge.svg)](https://github.com/AY2021S1-CS2103-W14-3/tp/actions) +[![codecov](https://codecov.io/gh/AY2021S1-CS2103-W14-3/tp/branch/master/graph/badge.svg)](https://codecov.io/gh/AY2021S1-CS2103-W14-3/tp) ![Ui](images/Ui.png) -**AddressBook is a desktop application for managing your contact details.** While it has a GUI, most of the user interactions happen using a CLI (Command Line Interface). +**Bamboo 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). -* 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 Bamboo, head over to the [_Quick Start_ section of the **User Guide**](UserGuide.html#quick-start). +* If you are interested about developing Bamboo, the [**Developer Guide**](DeveloperGuide.html) is a good place to start. **Acknowledgements** diff --git a/docs/team/hakiem526.md b/docs/team/hakiem526.md new file mode 100644 index 00000000000..e4cec135ac8 --- /dev/null +++ b/docs/team/hakiem526.md @@ -0,0 +1,34 @@ +--- +layout: page +title: Hakiem Rasid's Project Portfolio Page +--- + +## Project: Bamboo + +Bamboo (v1.4) is a **simple desktop app for managing personal finance, optimized for use via a Command Line Interface (CLI),** and targeted at college students. If you can type fast, Bamboo v1.4 can get your financial management tasks done faster than traditional GUI apps. + +Given below are my contributions to the project. + +* **New Feature**: Added the ability to view a graph representing categorical expenses. + * What it does: Allows the user to view a pie chart which represents the expenses divided into respective tags/categories. + * Justification: This feature allows the user to get a visual representation of the expenses by categories. + * Highlights: This enhancement requires an association class to get the necessary data from the expensebook and initialise a chart for the UI. This feature also requires some fxml and CSS for styling. + * Credits: *[Referenced code](https://docs.oracle.com/javafx/2/charts/pie-chart.htm)* + +* **Code contributed**: [RepoSense link](https://nus-cs2103-ay2021s1.github.io/tp-dashboard/#breakdown=true&search=hakiem526&sort=groupTitle&sortWithin=title&since=2020-08-14&until=2020-11-09&timeframe=commit&mergegroup=&groupSelect=groupByRepos&checkedFileTypes=docs~functional-code~test-code~other) + +* **Project management**: + * Assisted in assigning PRs to corresponding issues and milestones + +* **Enhancements to existing features**: + * Updated the GUI from AB3 to suit basic Bamboo functionality for v1.2 (Pull request [\#40](https://github.com/AY2021S1-CS2103-W14-3/tp/pull/40)) + * Added GUI for budget display in the form of a progress bar in the main window (Pull request [\#50](https://github.com/AY2021S1-CS2103-W14-3/tp/pull/50)) + * Fixed parsing of single word commands (Pull request [\#177](https://github.com/AY2021S1-CS2103-W14-3/tp/pull/177)) + * Updated the GUI for the budget bar to enable more accurate labelling depending on user commands (Pull request [\#169](https://github.com/AY2021S1-CS2103-W14-3/tp/pull/169)) + +* **Documentation**: + * User Guide: + * Added documentation for the feature `graph` [\#167](https://github.com/AY2021S1-CS2103-W14-3/tp/pull/167) + * Added example screenshot for feature 'graph' + * Developer Guide: + * Added implementation details of the `graph` feature and the respective UML diagrams. [\#68](https://github.com/AY2021S1-CS2103-W14-3/tp/pull/68) diff --git a/docs/team/jaylenlee.md b/docs/team/jaylenlee.md new file mode 100644 index 00000000000..075f256575c --- /dev/null +++ b/docs/team/jaylenlee.md @@ -0,0 +1,56 @@ +--- +layout: page +title: Lee Jian Hui's Project Portfolio Page +--- + +## Project: Bamboo + +Bamboo (v1.4) is a **simple desktop app for managing personal finance, optimized for use via a Command Line Interface (CLI),** and targeted at college students. If you can type fast, Bamboo v1.4 can get your financial management tasks done faster than traditional GUI apps. + +Given below are my contributions to the project. + +* **New Feature**: Added the ability to switch category in the expense book. + * What it does: allows the user to switch into another category with the given category input. Once switched, the list displayed will only show the expenses with the corresponding category and uses the specified budget assigned to this category. + * Justification: This feature improves the product significantly because a user can focus on the individual categories of expenses to look into and manage instead of having to do their own separate calculation manually to see where they overspent. + * 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 and some architecture designs. + * Credits: N.A + +* **New Feature**: Added a delete category command that allows the user to remove unwanted category. + * What it does: allows the user to delete a specified category from the expense book. Once deleted, the budget assigned to that category will be removed amd expenses associated with that category will automatically be reset to Default category. + * Justification: This feature improves the product significantly because a user can recover from adding the wrong category into the expense book and better manage their expenses if there is a certain category that they are no longer interested in or have no more need for. + * Highlights: This enhancement affects existing commands and commands to be added in future. It required an in-depth analysis of design alternatives. The designing process too was challenging as there are many variables to be concerned with as budget and expense are both intricately linked with category. + * Credits: N.A + +
+ +* **New Component**: Added a class containing a list of unique tag. + * What it does: contains a list of unique tags and allows tag list specified function. + * Justification: This component improves the execution significantly because categories can now be parsed and loaded to be used by the expensebook. + * Highlights: This enhancement affects existing commands and commands to be added in future. It required an in-depth analysis of design alternatives. + * Credits: N.A + +* **Code contributed**: [RepoSense link](https://nus-cs2103-ay2021s1.github.io/tp-dashboard/#breakdown=true&search=jaylenlee&sort=groupTitle&sortWithin=title&since=2020-08-14&timeframe=commit&mergegroup=&groupSelect=groupByRepos&checkedFileTypes=docs~functional-code~test-code~other&tabOpen=false) + +* **Project management**: + * Assisted in assigning PRs to corresponding issues and milestones + * Reviewed and merged PRs + +* **Enhancements to existing features**: + * Refactoring of names of existing classes to more suitable names (Pull requests [\#37](https://github.com/AY2021S1-CS2103-W14-3/tp/pull/37), [\#47](https://github.com/AY2021S1-CS2103-W14-3/tp/pull/47)) + * Modifying classes to encourage more abstraction barriers (Pull request [\#77](https://github.com/AY2021S1-CS2103-W14-3/tp/pull/77)) + * Fixing of bugs that causes unideal results (Pull request [\#155](https://github.com/AY2021S1-CS2103-W14-3/tp/pull/155), [\#156](https://github.com/AY2021S1-CS2103-W14-3/tp/pull/156)) + * Setting character limits to textfield input to prevent excessive amount of input to lag the application (Pull request [\#158](https://github.com/AY2021S1-CS2103-W14-3/tp/pull/158)) + +* **Documentation**: + * User Guide: + * Added initial documentation for basic features. [\#11](https://github.com/AY2021S1-CS2103-W14-3/tp/pull/11) + * Updated documentation to v1.2 [\#48](https://github.com/AY2021S1-CS2103-W14-3/tp/pull/48) + * Added documentation for the features `help`, `deleteCat` and `switch` [\#91](https://github.com/AY2021S1-CS2103-W14-3/tp/pull/91) + * Added example screenshots to features in Usage + * Developer Guide: + * Added implementation details of the `switch` feature. [\#66](https://github.com/AY2021S1-CS2103-W14-3/tp/pull/66) + * Updated `switch` feature, user stories, spacing and use case 13 [\#159](https://github.com/AY2021S1-CS2103-W14-3/tp/pull/159) + +* **Community**: + * PRs reviewed (with non-trivial review comments): [\#9](https://github.com/AY2021S1-CS2103-W14-3/tp/pull/9), [\#150](https://github.com/AY2021S1-CS2103-W14-3/tp/pull/150), [\#151](https://github.com/AY2021S1-CS2103-W14-3/tp/pull/151) + * Posted in forum discussions (examples: [\#77](https://github.com/nus-cs2103-AY2021S1/forum/issues/77)) diff --git a/docs/team/johndoe.md b/docs/team/johndoe.md deleted file mode 100644 index 1f1e9e6f6db..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/lebencwb.md b/docs/team/lebencwb.md new file mode 100644 index 00000000000..69f9049bc73 --- /dev/null +++ b/docs/team/lebencwb.md @@ -0,0 +1,30 @@ +--- +layout: page +title: Leben Chew's Project Portfolio Page +--- + +## Project: Bamboo + +Bamboo (v1.3) is a **simple desktop app for managing personal finance, optimized for use via a Command Line Interface (CLI),** and targeted at college students. If you can type fast, Bamboo v1.2 can get your financial management tasks done faster than traditional GUI apps. + +Given below are my contributions to the project. + +* **New Feature**: Added the ability to add categories of expenditure to the expense book. + * What it does: Allows the user to customize the categories and manage their finances according to the categories they have defined. + * Justification: This feature improves the product significantly because a user may need to manage their finances with more granular precision and set more concrete goals that they can better keep track of when their expenditure is categorized. + * Highlights: This feature is an optional extension, such that even first-time users can immediately start using the basic features of the application without having to create expenditure categories, with the implementation of a 'Default' category. + +* **New Feature**: Added a default category containing a default budget that can be topped-up (or reduced) and which expenses can be tagged to and deducted from. Also added the ability for the user specify the category-budget that they want to top up, as well as reduce the budget when necessary. + +* **Code contributed**: [RepoSense link](https://nus-cs2103-ay2021s1.github.io/tp-dashboard/#breakdown=true&search=lebencwb) + +* **Project management**: + * Created milestones and issues, set deadlines and assign labels and developers: [Issues link](https://github.com/AY2021S1-CS2103-W14-3/tp/issues?q=author%3Alebencwb+) + +* **Documentation**: + * User Guide: + * Added documentation for the features `add category`, `top-up category-budget`, `reduce category-budget` [\#90](https://github.com/AY2021S1-CS2103-W14-3/tp/pull/90), [\#175](https://github.com/AY2021S1-CS2103-W14-3/tp/pull/175) + * Developer Guide: + * Added implementation details of the `default category` and `category-budget adding, topping-up and reducing` features. [\#70](https://github.com/AY2021S1-CS2103-W14-3/tp/pull/70), [\#175](https://github.com/AY2021S1-CS2103-W14-3/tp/pull/175) + +* **Review contributions**: [PRs reviewed](https://github.com/AY2021S1-CS2103-W14-3/tp/issues?q=reviewed-by%3Alebencwb) diff --git a/docs/team/marcus2k.md b/docs/team/marcus2k.md new file mode 100644 index 00000000000..4fe29ff1359 --- /dev/null +++ b/docs/team/marcus2k.md @@ -0,0 +1,53 @@ +--- +layout: page +title: Marcus's Project Portfolio Page +--- + +## Project: AddressBook Level 3 + +Bamboo (v1.4) is a **simple desktop app for managing personal finance, optimized for use via a Command Line Interface (CLI),** and targeted at college students. If you can type fast, Bamboo v1.4 can get your financial management tasks done faster than traditional GUI apps. + +Given below are my contributions to the project. + +* **New Feature**: Added the ability to add shortcuts (aliases) to each command. + * What it does: allows users to add up to ONE customised command word for all commands except alias and resetAlias. Restrictions on user input and more specific usage details can be found in the User Guide. + * Justification: As an experienced user, the user should be able to customise the command word using alias shortcuts for faster workflow. Being experienced also likely means that he is either a long-time user or a frequent user. The alias and resetAlias commands cannot have aliases as a neat fail-safe. + * Highlights: `find [oldAlias] [newAlias]` will override the old alias with the new alias. If there are no aliases currently for a command, then simply use `find [defaultCommandWord] [newAlias]`. + * Additional model classes implemented for this feature: `AliasMap`, `AliasEntry`, and their JSON Storage Formatting Classes + * Credits: *{AliasMap class design inspired by AddressBook3's AddressBook class}* + +* **New Feature**: Added the ability to remove shortcuts (aliases) for commands all at once. + * What it does: allows users to add up to ONE customised command word for all commands except alias and resetAlias. Restrictions on user input and more specific usage details can be found in the User Guide. + * Justification: A user may have not used the app for quite some time, and forgot all the aliases he/she have customised. Since aliases will not be visible in user guide, he/she can simply run `resetAlias` and can resume using the app with the command words as shown in the user guide. + +* **Updated Feature**: Altered find command to perform partial description keyword or date matching or both. + * What it does: filters expenses list to only show expenses with description that partially contains one of the keywords (e.g. `find -d pasta` will include in its output an expense with a description containing the word `pastafarian`) and contains one of the dates. + * Justification: This feature allows users to filter out expenses for a particular day or expenses whose description contains a particular keyword. These features are important for users to be able to reflect on his total spending on a particular day or on a particular item, and learn from any spending mistakes. + * Credits: The current find feature implementation was enhanced from AddressBook3’s find feature which allowed us to do description matching, from which date matching was then extended. + * Other: Previously implemented and subsequently removed tag matching support due to the introduction of expense book categories in the Bamboo project. + +* **Code contributed**: [RepoSense link](https://nus-cs2103-ay2021s1.github.io/tp-dashboard/#breakdown=true&search=marcus2k&sort=groupTitle&sortWithin=title&since=2020-08-14&timeframe=commit&mergegroup=&groupSelect=groupByRepos&checkedFileTypes=docs~functional-code~test-code~other&tabOpen=false) + +* **Project management**: + * Opened and resolved issues + * Reviewed and merged PRs + +* **Enhancements to existing features**: + * Updated the find command (Pull requests [\#42](https://github.com/AY2021S1-CS2103-W14-3/tp/pull/42)) + * Wrote additional tests for `alias` and `resetAlias` feature to increase coverage from 62.84% to 65.05% (Pull requests [\#154](https://github.com/AY2021S1-CS2103-W14-3/tp/pull/154)) + * Add feature restrictions or update behaviours with justifications (Pull requests [\#84](https://github.com/AY2021S1-CS2103-W14-3/tp/pull/84)) + +* **Documentation**: + * User Guide: + * Updated documentation for the features `find` and `alias` (Pull requests [\#88](https://github.com/AY2021S1-CS2103-W14-3/tp/pull/88), [\#165](https://github.com/AY2021S1-CS2103-W14-3/tp/pull/165)) + * Added documentation for the features `resetAlias` [\#165](https://github.com/AY2021S1-CS2103-W14-3/tp/pull/165) + * Developer Guide: + * Added implementation details of the `alias` feature. [\#165](https://github.com/AY2021S1-CS2103-W14-3/tp/pull/165) + +* **Community**: + * Reported bugs: [\#163](https://github.com/AY2021S1-CS2103-W14-3/tp/issues/163), [\#153](https://github.com/AY2021S1-CS2103-W14-3/tp/issues/153) + * PRs reviewed and merged: [\#37](https://github.com/AY2021S1-CS2103-W14-3/tp/pull/37), [\#14](https://github.com/AY2021S1-CS2103-W14-3/tp/pull/14), [\#66](https://github.com/AY2021S1-CS2103-W14-3/tp/pull/66), [\#89](https://github.com/AY2021S1-CS2103-W14-3/tp/pull/89), [\#95](https://github.com/AY2021S1-CS2103-W14-3/tp/pull/95) + * Asked question in forum [1](https://github.com/nus-cs2103-AY2021S1/forum/issues/130) + * Reported bugs and suggestions for other teams in the class (examples: [1](https://github.com/AY2021S1-CS2103-F09-3/tp/issues/176), [2](https://github.com/AY2021S1-CS2103-F09-3/tp/issues/175), [3](https://github.com/AY2021S1-CS2103-F09-3/tp/issues/174), [4](https://github.com/AY2021S1-CS2103-F09-3/tp/issues/172)) + +* _{you can add/remove categories in the list above}_ diff --git a/docs/team/maxxyh.md b/docs/team/maxxyh.md new file mode 100644 index 00000000000..76cd61de4e5 --- /dev/null +++ b/docs/team/maxxyh.md @@ -0,0 +1,59 @@ +--- +layout: page +title: Maxx Chan's Project Portfolio Page +--- + +## Project: Bamboo + +Bamboo (v1.4) is a **simple desktop app for managing personal finance, optimized for use via a Command Line Interface (CLI),** and targeted at college students. If you can type fast, Bamboo v1.4 can get your financial management tasks done faster than traditional GUI apps. + +Given below are my contributions to the project. + +* **New Feature**: Added the ability to sort expenses. (Pull Request [\#86](https://github.com/AY2021S1-CS2103-W14-3/tp/pull/86)) + - What it does: allows the user to sort expenses currently displayed on the application based on Amount, Description (alphabetical), and Date of Expense. Users can use at least, and up to 3 of the sorting criterion - they will be applied with priority in order of appearance. Users also have the option to do a reverse sort for criterion. + - Justification: This feature improves the product significantly because a user can better organise how expenses are displayed on the application. Specifically: + - Amount sort allows the user to find out which expenses contribute the most/least to his spending. + - Description sort allows the user to organise expenses with similar descriptions together. + - Date sort allows the user to have a chronological overview of his spending. + - Highlights: Priority sort for multiple keywords was an intentional design choice which added additional layers of complexity. Sorting also works together with filtering. While sorting itself is not complicated, this feature was challenging as JavaFX does not support both sorting and filtering at the same time natively. Workarounds had to be used. + +* **Code contributed**: [RepoSense link](https://nus-cs2103-ay2021s1.github.io/tp-dashboard/#breakdown=true&search=maxxyh&sort=groupTitle&sortWithin=title&since=2020-08-14&timeframe=commit&mergegroup=&groupSelect=groupByRepos&checkedFileTypes=docs~functional-code~test-code~other&tabOpen=false&until=2020-11-09) + +* **Project management**: + * Team leader - delegation of work to members. + * Managed all releases `v1.2` - `v1.4` (4 releases) on GitHub. + * Opened, tagged and resolved Issues according to priority, category and person-in-charge. + * Managed closing of milestones and shifting unfinished tasks to later milestones. + * Reviewed and merged PRs. + * Created v1.2, v1.3, v1.4 demos. + * Bug reporting (Issues [\#94](https://github.com/AY2021S1-CS2103-W14-3/tp/issues/94), [\#98](https://github.com/AY2021S1-CS2103-W14-3/tp/issues/98), [\#99](https://github.com/AY2021S1-CS2103-W14-3/tp/issues/99), [\#171](https://github.com/AY2021S1-CS2103-W14-3/tp/issues/171)) + +
+ +* **Refactoring** + * Refactored sample data and test classes from AB3 to fit Bamboo's purposes (Pull requests [\#44](https://github.com/AY2021S1-CS2103-W14-3/tp/pull/44)) + * Refactored classes from AB3 to fit Bamboo's needs (Pull requests [\#30](https://github.com/AY2021S1-CS2103-W14-3/tp/pull/30), [\#32](https://github.com/AY2021S1-CS2103-W14-3/tp/pull/32)) + +* **Enhancements to existing features**: + * Changed the datatype used in Amount class so that it would not overflow and was more suitable for storing money. (Pull requests [\#150](https://github.com/AY2021S1-CS2103-W14-3/tp/pull/150), [\#157](https://github.com/AY2021S1-CS2103-W14-3/tp/pull/157), [\#171](https://github.com/AY2021S1-CS2103-W14-3/tp/pull/171)) + * Wrote additional tests for `sort` feature (Pull request [\#86](https://github.com/AY2021S1-CS2103-W14-3/tp/pull/86)) + +* **Documentation**: + * User Guide: + * Did overall formatting and proofreading of user guide. (Pull requests [\#100](https://github.com/AY2021S1-CS2103-W14-3/tp/pull/100), [#152](https://github.com/AY2021S1-CS2103-W14-3/tp/pull/152)) + * Updated Command Format Guide, Quick Start, Features section. (Pull requests [\#152](https://github.com/AY2021S1-CS2103-W14-3/tp/pull/152)) + * Updated Glossary section with input restrictions. (Pull request [\#152](https://github.com/AY2021S1-CS2103-W14-3/tp/pull/152)) + * Added documentation for the features `sort`, `clear` and `exit`. (Pull requests [\#89](https://github.com/AY2021S1-CS2103-W14-3/tp/pull/89)) + * Touch up existing documentation for `alias`, `switch`, `addCat`, `deleteCat`, `find`. (Pull requests [\#100](https://github.com/AY2021S1-CS2103-W14-3/tp/pull/100)) + * Add app screenshots for all commands. + * Developer Guide: + * Added implementation details of the `sort` feature. (Pull requests [\#72](https://github.com/AY2021S1-CS2103-W14-3/tp/pull/72)) + * Updated use cases U7-U12, user stories. (Pull requests [\#97](https://github.com/AY2021S1-CS2103-W14-3/tp/pull/97)) + * Updated diagrams to reflect latest architecture. (Pull requests [\#97](https://github.com/AY2021S1-CS2103-W14-3/tp/pull/97)) + +* **Community**: + * PRs reviewed (with non-trivial review comments): (Pull requests [\#140](https://github.com/AY2021S1-CS2103-W14-3/tp/pull/140), [\#156](https://github.com/AY2021S1-CS2103-W14-3/tp/pull/156), [\#155](https://github.com/AY2021S1-CS2103-W14-3/tp/pull/155), [\#162](https://github.com/AY2021S1-CS2103-W14-3/tp/pull/162)) + * Reported bugs and suggestions for other teams (examples: [1](https://github.com/AY2021S1-CS2103-T16-3/tp/issues/155), [2](https://github.com/AY2021S1-CS2103-T16-3/tp/issues/156), [3](https://github.com/AY2021S1-CS2103-T16-3/tp/issues/157), [4](https://github.com/AY2021S1-CS2103-T16-3/tp/issues/158), [5](https://github.com/AY2021S1-CS2103-T16-3/tp/issues/159)) + +* **Tools**: + * Introduced the team to Notion to store notes and tasks from our team meetings. diff --git a/docs/tutorials/AddRemark.md b/docs/tutorials/AddRemark.md deleted file mode 100644 index 6907e29456c..00000000000 --- a/docs/tutorials/AddRemark.md +++ /dev/null @@ -1,394 +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 an `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 -