diff --git a/README.md b/README.md index 13f5c77403f..7202f0a5a43 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,18 @@ -[![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/AY2021S2-CS2103-T16-3/tp/workflows/Java%20CI/badge.svg)](https://github.com/AY2021S2-CS2103-T16-3/tp/actions) +## User Interface ![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. +## About ResidenceTracker
+ResidenceTracker is a command line based desktop application that assists landlords in managing their residences that they are listing out on the Airbnb platform for rent. + +* It gives user convenience by providing a centralised overview of all the user's residences and the respective bookingList/cleaning statuses of each residence. + +* It uses a **quick CLI** way to note down bookings and track status of different residence, such as + clean or needs cleaning/booked or available, so the landlord can process bookings more efficiently and inform the cleaning agent as necessary before the next lease arrives. + +* It is **written in OOP fashion**. + +* This project is based on the AddressBook-Level3 project created by the [SE-EDU initiative](https://se-education.org). + +* For more details on ResidenceTracker, please refer to our [User Guide](docs/UserGuide.md). diff --git a/build.gradle b/build.gradle index be2d2905dde..e161c7f7481 100644 --- a/build.gradle +++ b/build.gradle @@ -66,7 +66,14 @@ dependencies { } shadowJar { - archiveName = 'addressbook.jar' + manifest { + attributes "Main-Class": 'seedu.address.Main' + archiveName("residencetracker.jar") + } } defaultTasks 'clean', 'test' + +run { + enableAssertions = true +} diff --git a/config/checkstyle/checkstyle.xml b/config/checkstyle/checkstyle.xml index 4c001417aea..6b34e465551 100644 --- a/config/checkstyle/checkstyle.xml +++ b/config/checkstyle/checkstyle.xml @@ -1,7 +1,7 @@ + "-//Checkstyle//DTD Checkstyle Configuration 1.3//EN" + "https://checkstyle.org/dtds/configuration_1_3.dtd"> - - - - + + + + @@ -216,7 +213,7 @@ some other variants which we don't publicized to promote consistency). --> + value="fall through|Fall through|fallthru|Fallthru|falls through|Falls through|fallthrough|Fallthrough|No break|NO break|no break|continue on"/> @@ -359,14 +356,12 @@ --> diff --git a/docs/AboutUs.md b/docs/AboutUs.md index 1c9514e966a..d7c05bdb3bc 100644 --- a/docs/AboutUs.md +++ b/docs/AboutUs.md @@ -9,51 +9,49 @@ You can reach us at the email `seer[at]comp.nus.edu.sg` ## Project team -### John Doe +### Lim Li Gang - + -[[homepage](http://www.comp.nus.edu.sg/~damithch)] -[[github](https://github.com/johndoe)] -[[portfolio](team/johndoe.md)] +[[github](https://github.com/whatthelump)] -* Role: Project Advisor +* Role: Code Quality and Documentation +* Responsibilities: _TBC_ -### Jane Doe +### Aw Zhen Yi - + -[[github](http://github.com/johndoe)] -[[portfolio](team/johndoe.md)] +[[github](http://github.com/awzhenyi)] -* Role: Team Lead -* Responsibilities: UI +* Role: Developer +* Responsibilities: _TBC_ -### Johnny Doe +### Teng Shu Wei Jared - + -[[github](http://github.com/johndoe)] [[portfolio](team/johndoe.md)] +[[github](http://github.com/jaredtengsw)] * Role: Developer -* Responsibilities: Data +* Responsibilities: _TBC_ -### Jean Doe +### V R Soorya - + -[[github](http://github.com/johndoe)] -[[portfolio](team/johndoe.md)] +[[github](http://github.com/vrsoorya)] +[[portfolio](team/vrsoorya.md)] * Role: Developer -* Responsibilities: Dev Ops + Threading +* Responsibilities: Dev Ops -### James Doe +### Wang Tao - + -[[github](http://github.com/johndoe)] -[[portfolio](team/johndoe.md)] +[[github](http://github.com/wangtao0717)] +[[portfolio](team/wangtao0717.md)] * Role: Developer -* Responsibilities: UI +* Responsibilities: _TBC_ diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index 4829fe43011..eb549b99d81 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/ay2021s2-cs2103-t16-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/ay2021s2-cs2103-t16-3/tp/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, * 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,7 +62,7 @@ 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/ay2021s2-cs2103-t16-3/tp/tree/master/src/main/java/seedu/address/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. @@ -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/ay2021s2-cs2103-t16-3/tp/tree/master/src/main/java/seedu/address/logic/Logic.java) -1. `Logic` uses the `AddressBookParser` class to parse the user command. +1. `Logic` uses the `ResidenceTrackerParser` 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 residence). 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,16 @@ 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/ay2021s2-cs2103-t16-3/tp/tree/master/src/main/java/seedu/address/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 residence tracker 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 `ResidenceTracker`, which `Residence` references. This allows `ResidenceTracker` to only require one `Tag` object per unique `Tag`, instead of each `Residence` needing their own `Tag` object.
![BetterModelClassDiagram](images/BetterModelClassDiagram.png)
@@ -117,15 +116,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/ay2021s2-cs2103-t16-3/tp/tree/master/src/main/java/seedu/address/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 residence tracker 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.address.commons` package. -------------------------------------------------------------------------------------------------------------------- @@ -133,89 +132,65 @@ 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 - -#### Proposed Implementation - -The proposed undo/redo mechanism is facilitated by `VersionedAddressBook`. It extends `AddressBook` with an undo/redo history, stored internally as an `addressBookStateList` and `currentStatePointer`. Additionally, it implements the following operations: +### Remind feature -* `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. +#### Implementation -These operations are exposed in the `Model` interface as `Model#commitAddressBook()`, `Model#undoAddressBook()` and `Model#redoAddressBook()` respectively. +The proposed mechanism is facilitated by the `logic` component described above. It filters the displayed `Residence` list to show those with bookings starting in the next 7 days. It makes use of the following new method in `Residence`. -Given below is an example usage scenario and how the undo/redo mechanism behaves at each step. +* `Residence#hasUpcomingBooking()` — Returns true if the `Residence` has a booking starting in the next 7 days. -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. +These operations make use of the `Model` interface's `Model#updateFilteredResidenceList(Predicate predicate)` method and `Model` has a new public static `Predicate` named `PREDICATE_UPCOMING_BOOKED_RESIDENCES`. -![UndoRedoState0](images/UndoRedoState0.png) +Given below is an example usage scenario and how the reminder filtering mechanism behaves at each step. -Step 2. The user executes `delete 5` command to delete the 5th person in the address book. The `delete` command calls `Model#commitAddressBook()`, causing the modified state of the address book after the `delete 5` command executes to be saved in the `addressBookStateList`, and the `currentStatePointer` is shifted to the newly inserted address book state. +Step 1. The user launches the application for the first time. The `ResidenceTracker` will be initialized with the initial residence tracker state. -![UndoRedoState1](images/UndoRedoState1.png) +Step 2. The user executes `addb 2 n/New Tenant p/098 ...` command to add a booking that starts within the next 7 days to the 2nd residence in the residence tracker. The `addb` command calls `Residence#addBooking(Booking booking)`, which replaces the 2nd residence with the new `Residence` after the command execution. -Step 3. The user executes `add n/David …​` to add a new person. The `add` command also calls `Model#commitAddressBook()`, causing another modified address book state to be saved into the `addressBookStateList`. +Step 3. The user executes `remind` to list all residences with upcoming bookings. The `remind` command also calls `Model#updateFilteredResidenceList(Predicate predicate)`, causing a filtered list of `Residence`s to be displayed which includes the updated residence from the previous step. -![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 4. The user now decides that adding the person was a mistake, and decides to undo that action by executing the `undo` command. The `undo` command will call `Model#undoAddressBook()`, which will shift the `currentStatePointer` once to the left, pointing it to the previous address book state, and restores the address book to that state. - -![UndoRedoState3](images/UndoRedoState3.png) - -
: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. - -
+Step 4. Any successful execution of commands `add`, `addb`, `edit`, `editb`, `delete`, `deleteb` or `list` will return to the previous display of the full residence list. -The following sequence diagram shows how the undo operation works: - -![UndoSequenceDiagram](images/UndoSequenceDiagram.png) - -
:information_source: **Note:** The lifeline for `UndoCommand` should end at the destroy marker (X) but due to a limitation of PlantUML, the lifeline reaches the end of diagram. - -
- -The `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. +#### Design consideration: -
: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. +##### Aspect: How undo & redo executes -
+* **Alternative 1 (current choice):** Checks if residences have bookings starting in the next 7 days. + * Pros: Easy to implement. + * Cons: User is forced to actively use the command to be reminded. -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. +* **Alternative 2:** Residences are automatically displayed with residences having upcoming bookings on top. + * Pros: Users will be able to see the residences that need the most urgent attention on top of their list without interacting with the app. + * Cons: The users will not be able to tell how many in the list will need to be cleaned immediately for the next 7 days. + Using colour codes to differentiate the residences from the rest will make it visually more unpleasant for the users as it already uses colour coding for bookings. -![UndoRedoState4](images/UndoRedoState4.png) +### Status feature -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. +#### Implementation -![UndoRedoState5](images/UndoRedoState5.png) +The proposed mechanism is facilitated by the `logic` component described above. It updates clean status of multiple `Residences` at one time. It makes use of the following new method. -The following activity diagram summarizes what happens when a user executes a new command: +* `StausCommand#createUpdatedResidence()` —  Create updated residence with the required clean status and the same other data. +* `StausCommandParser#paser()` —  Manage the status command input, return a status command with required clean status and target residence index list. -![CommitActivityDiagram](images/CommitActivityDiagram.png) +These operations make use of the `Model` interface's `Model#updateFilteredResidenceList(Predicate predicate)` method to update the order of residence list, +and `Model#setResidence()` to update the residence in the residence list. -#### Design consideration: +Given below is an example usage scenario and how the `status` filtering mechanism behaves at each step. -##### Aspect: How undo & redo executes +Step 1. The user launches the application for the first time. The `ResidenceTracker` will be initialized with the initial residence tracker state. -* **Alternative 1 (current choice):** Saves the entire address book. - * Pros: Easy to implement. - * Cons: May have performance issues in terms of memory usage. +Step 2. The user executes two or more input`add n/NAME a/ADDRESS c/y ...` command to add multiple residence with the same clean status "CLEAN". The `add` command calls `addResidence()` which checks and adds new residence to the end of unique residence list where "UNCLEAN" residences is in front of "CLEAN" residences. -* **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 executes `status unclean 4 5` to update the forth and fifth residences' clean status to "UNCLEAN". The `status` command also calls `Model#updateFilteredResidenceList(Predicate predicate)`, causing an ordered list of `Residence`s to be displayed. -_{more aspects and alternatives to be added}_ +The following sequence diagram shows how the status operation works: -### \[Proposed\] Data archiving +![StatusSequenceDiagram](images/StatusSequenceDiagram.png) -_{Explain here how the data archiving feature will be implemented}_ +The following activity diagram summarizes what happens when a user executes a `status` command: +![StatusActivityDiagram](images/StatusActivityDiagram.png) -------------------------------------------------------------------------------------------------------------------- @@ -236,63 +211,219 @@ _{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 +* busy user that has to manage a considerable number of residences +* is constantly renting out residences; high turnover rate +* prefers working on laptop over mobile +* is able to type quickly +* prefers using a keyboard to using a mouse +* is familiar with CLI apps -**Value proposition**: manage contacts faster than a typical mouse/GUI driven app +**Value proposition**: easily keep track of residences and inform cleaning agency whenever necessary ### 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…​ | +| -------- | ------------------------------------------ | ----------------------------------- | ---------------------------------------------------------------------- | +| `* * *` | new user | See a list of all commands | refer to instructions when I forget how to use the App | +| `* * *` | user | add a new residence | manage all the residences I wish to keep track of | +| `* * *` | user | delete a residence | remove residences that I no longer need to track | +| `* * *` | user | find a residence by name | review details of specific residences without having to go through the entire list | +| `* *` | new user | clear all sample residences | begin using Residence Tracker with my own data quickly +| `* *` | user | edit a residence | change the information of a residence when necessary | +|`* *` | user | exit the application | use my computer for other stuff +|`* *` | user | go through a tutorial guide | quickly learn the usage of the application +|`* *` | user | add a new booking of a residence | keep track of all booking information of my residences +|`* *` | user | edit a new booking of a residence | change the information of booking when necessary +|`* *` | user | delete a new booking of a residence | remove booking details that I no longer need to track +|`* *` | busy user | be reminded me of upcoming bookings | quickly view the residences that need to be urgently cleaned +| `*` | busy user renting out many residences | update status of multiple residence at once | save time and get to my other works | + *{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 `ResidenceTracker` and the **Actor** is the `user`, unless specified otherwise) -**Use case: Delete a person** +**Use case (UC01): Add a residence**
+**MSS**
+1. User adds in the details of a residence. +2. User validates the details of the residence to be added. +3. System confirms the addition and residence is added to the list of existing residence. +4. System saves the updated data. +
Use case ends. -**MSS** +**Extensions** -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 +* 2a. System detects error in submission if user did not provide all relevant fields correctly.
+ * 2a1. ResidenceTracker shows an error message.
+ use case restarts from 1. +
- Use case ends. +**Use case (UC02): Delete a residence**
+**MSS**
+1. User deletes a residence. +2. System validates the residence to be deleted. +3. System deletes the respective entry of the residence. +4. System saves the updated data. +
Use case ends. **Extensions** -* 2a. The list is empty. +* 2a. System detects an error in the user input. + * 2a1. System requests for the expected format to delete a residence. + * 2a2. User inputs the corrected details to delete a residence. + + Use case resumes at step 2. + +
+ +**Use case(UC03): Find a residence**
+**MSS**
+1. User searches residences with keywords. +2. System returns the residence(s) which include the keyword in their name. +
Use case ends. + +**Extensions**
+* 1a. System found no matching residences. + * 1a1. A corresponding message is shown and the residence list displayed is empty. +
Use case ends. + +
+ +**Use case(UC04): View list of all residences**
+**MSS**
+1. User lists all residences. +2. System displays all residences in the list. +
Use case ends. + +
+ +**Use case(UC05): Edit information of a residence**
+**MSS**
+1. User edits a residence. +2. System validates the edits to the given residence. +3. System updates the residence accordingly. +4. System saves the updated data. +
Use case ends. + +**Extensions**
+* 2a. System detects an error in the user input. + * 2a1. System requests for the expected input format to edit a residence. + * 2a2. User inputs the corrected details to edit a residence. +
Use case resumes at step 2. + +
+ +**Use case (UC06): Show all available commands**
+**MSS**
+1. User requests the help page. +2. System displays the help page. +
Use case ends. + +
+ +**Use case (UC07): Exit the application**
+**MSS**
+1. User exits the application. +2. System shuts down. +
Use case ends. + +
+ +**Use case(UC08): Update clean status of multiple residences at once**
+**MSS**
+1. User updates multiple residences' clean status at once. +2. System confirms the validity of clean status and residences provided. +3. System updates the required residences' clean status. +4. System saves the updated data. +
Use case ends. + +**Extensions**
+* 2a. System detects an error in the user input. + + * 2a1. System requests for the expected format to update multiple residences' clean status. + * 2a2. User inputs the corrected details to update multiple residences' clean status. +
Use case resumes at step 2. + +
+ +**Use case(UC09): Adds a new booking of the specified residence**
+**MSS**
+1. User adds a new booking to a residence. +2. System confirms the validity of the residence and the new booking details. +3. System adds the new booking to the residence's booking list. +4. System saves the updated data. +
Use case ends. + +**Extensions**
+* 2a. System detects an error in the user input. + + * 2a1. System requests for the expected format to add a booking to a residence. + * 2a2. User inputs the corrected details to add a booking to a residence. +
Use case resumes at step 2. + +
+ +**Use case(UC10): edit a booking of the specified residence**
+**MSS**
+1. User edits a residence's booking. +2. System confirms the validity of the residence and the edited booking details. +3. System updates the given booking in the residence's booking list. +4. System saves the updated data. +
Use case ends. + +**Extensions**
+* 2a. System detects an error in the user input + + * 2a1. System requests for the expected format of editing a residence's booking. + * 2a2. User inputs the corrected details to edit a residence's booking. +
Use case resumes at step 2. + +
+ +**Use case (UC11): Delete a booking of a residence** - Use case ends. +**MSS** +1. User deletes a booking from a residence. +2. System validates the booking to be deleted. +3. System deletes the respective entry of the booking from the given residence. +4. System saves the updated data. +
Use case ends. -* 3a. The given index is invalid. +**Extensions** - * 3a1. AddressBook shows an error message. +* 2a. System detects an error in the user input. - Use case resumes at step 2. + * 2a1. System requests for the correct format to delete a booking from a residence. + * 2a2. User inputs the corrected details to delete a booking from a residence. +
Use case resumes at step 2. -*{More to be added}* +
+ +**Use case (UC12): Reminder of Residences with Upcoming Bookings**
+**MSS**
+1. User requests a reminder of residences with upcoming bookings. +2. System shows a list of all residences with bookings starting in the next 7 days. +
Use case ends. + +
+ +**Use case (UC13): CLear all residence at once**
+**MSS**
+1. User chooses to clear all residences. +2. System deletes all residence data from the storage file. +
Use case ends. + +
### Non-Functional Requirements 1. Should work on any _mainstream OS_ as long as it has Java `11` or above installed. -2. Should be able to hold up to 1000 persons without a noticeable sluggishness in performance for typical usage. +2. Should be able to hold up to 100 residences without a noticeable sluggishness in performance for typical usage. 3. A user with above average typing speed for regular English text (i.e. not code, not system admin commands) should be able to accomplish most of the tasks faster using commands than using the mouse. *{More to be added}* @@ -300,8 +431,10 @@ Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unli ### Glossary * **Mainstream OS**: Windows, Linux, Unix, OS-X -* **Private contact detail**: A contact detail that is not meant to be shared with others - +* **Residence Status**: + * **Clean**: The residence has been cleaned + * **Unclean**: The residence needs to be cleaned + -------------------------------------------------------------------------------------------------------------------- ## **Appendix: Instructions for manual testing** @@ -328,29 +461,34 @@ 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 a residence -1. Deleting a person while all persons are being shown +1. Deleting a residence while all residence are being shown - 1. Prerequisites: List all persons using the `list` command. Multiple persons in the list. + 1. Prerequisites: List all residences using the `list` command. Multiple residences 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 residence is deleted from the list. Details of the deleted residence shown in the status message. 1. Test case: `delete 0`
- Expected: No person is deleted. Error details shown in the status message. Status bar remains the same. + Expected: No residence is deleted. Error details shown in the status message. Status bar remains the same. 1. Other incorrect delete commands to try: `delete`, `delete x`, `...` (where x is larger than the list size)
Expected: Similar to previous. -1. _{ more test cases …​ }_ - ### Saving data -1. Dealing with missing/corrupted data files +1. Dealing with corrupted data files + + 1. Prerequisites: There are some stored residences in the residence tracker. The app is closed. + + 1. Test case: corrupted `residencetracker.json`
+ Steps: First edit the `residencetracker.json` such that it becomes an invalid format by removing a single `}` at the end of the file. Open the residence tracker.
+ Expected: The residence tracker will start but the residence list will be empty (i.e all previous data is lost). Add a few residences and try other commands. They should work as expected. - 1. _{explain how to simulate a missing/corrupted file, and the expected behavior}_ + 1. Test case: missing `residencetracker.json`
+ Steps: Exit the residence tracker. First delete the `residencetracker.json` from the `/data` directory. Open the residence tracker.
+ Expected: The residence tracker will start with only the sample data. + 1. _{ more test cases …​ }_ diff --git a/docs/SettingUp.md b/docs/SettingUp.md index 77667c6d581..04c6360553a 100644 --- a/docs/SettingUp.md +++ b/docs/SettingUp.md @@ -45,11 +45,4 @@ If you plan to use Intellij IDEA (highly recommended): 1. **Learn the design** - When you are ready to start coding, we recommend that you get some sense of the overall design by reading about [AddressBook’s architecture](DeveloperGuide.md#architecture). - -1. **Do the tutorials** - These tutorials will help you get acquainted with the codebase. - - * [Tracing code](tutorials/TracingCode.md) - * [Removing fields](tutorials/RemovingFields.md) - * [Adding a new command](tutorials/AddRemark.md) + When you are ready to start coding, we recommend that you get some sense of the overall design by reading about [ResidenceTracker’s architecture](DeveloperGuide.md#architecture). diff --git a/docs/UserGuide.md b/docs/UserGuide.md index 3716f3ca8a4..424974f3295 100644 --- a/docs/UserGuide.md +++ b/docs/UserGuide.md @@ -3,7 +3,11 @@ 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. + +ResidenceTracker (RT) is a **desktop app for managing residences, 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, RT can get your residence management tasks done faster than traditional GUI apps. + +In addition to being able to managing several residences at once with just a few key strokes of the keyboard, +ResidenceTracker helps users to also keep track of any bookings a residence has, overseeing multiple residences with ease. * Table of Contents {:toc} @@ -14,9 +18,9 @@ AddressBook Level 3 (AB3) is a **desktop app for managing contacts, optimized fo 1. Ensure you have Java `11` or above installed in your Computer. -1. Download the latest `addressbook.jar` from [here](https://github.com/se-edu/addressbook-level3/releases). +1. Download the latest `residencetracker.jar` from [here](https://github.com/AY2021S2-CS2103-T16-3/tp/releases). -1. Copy the file to the folder you want to use as the _home folder_ for your AddressBook. +1. Copy the file to the folder you want to use as the _home folder_ for your ResidenceTracker. 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) @@ -24,14 +28,11 @@ AddressBook Level 3 (AB3) is a **desktop app for managing contacts, optimized fo 1. Type the command in the command box and press Enter to execute it. e.g. typing **`help`** and pressing Enter will open the help window.
Some example commands you can try: - * **`list`** : Lists all contacts. - - * **`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. - + * **`list`** : Lists all residences in the app. + * **`add`**`n/Clementi HDB a/459A Clementi Ave 3, #04-257, S121459 c/n` : Adds a residence named `Clementi HDB` to the ResidenceTracker. + * **`edit`**`1 c/y` : edit the first residence clean status as Clean. + * **`delete`**`3` : Deletes the 3rd residence shown in the current list. + * **`clear`** : Deletes all residences. * **`exit`** : Exits the app. 1. Refer to the [Features](#features) below for details of each command. @@ -45,19 +46,19 @@ AddressBook Level 3 (AB3) is a **desktop app for managing contacts, optimized fo **: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`. + e.g. in `add n/NAME`, `NAME` is a parameter which can be used as `add n/Amber Heights`. * Items in square brackets are optional.
- e.g `n/NAME [t/TAG]` can be used as `n/John Doe t/friend` or as `n/John Doe`. + e.g `n/NAME [t/TAG]` can be used as `n/Amber Heights t/friend` or as `n/Amber Heights`. * Items with `…`​ after them can be used multiple times including zero times.
e.g. `[t/TAG]…​` can be used as ` ` (i.e. 0 times), `t/friend`, `t/friend t/family` etc. * Parameters can be in any order.
- e.g. if the command specifies `n/NAME p/PHONE_NUMBER`, `p/PHONE_NUMBER n/NAME` is also acceptable. + e.g. if the command specifies `n/NAME a/ADDRESS`, `a/ADDRESS n/NAME` is also acceptable. * If a parameter is expected only once in the command but you specified it multiple times, only the last occurrence of the parameter will be taken.
- e.g. if you specify `p/12341234 p/56785678`, only `p/56785678` will be taken. + e.g. if you specify `a/Jurong West St 60 a/Jurong West St 70`, only `a/Jurong West St 70` will be taken. * Extraneous parameters for commands that do not take in parameters (such as `help`, `list`, `exit` and `clear`) will be ignored.
e.g. if the command specifies `help 123`, it will be interpreted as `help`. @@ -66,88 +67,175 @@ AddressBook Level 3 (AB3) is a **desktop app for managing contacts, optimized fo ### Viewing help : `help` -Shows a message explaning how to access the help page. +Shows a message with the current list of commands along with examples. +It also provides a button to copy the URL link to access the help page. ![help message](images/helpMessage.png) Format: `help` -### Adding a person: `add` +### Adding a residence: `add` -Adds a person to the address book. +Adds a new residence to the list of residences, default for clean status is ‘clean’. Valid clean status inputs are `y`,`n`, `clean` and `unclean` -Format: `add n/NAME p/PHONE_NUMBER e/EMAIL a/ADDRESS [t/TAG]…​` +* Names can include `@` inside. e.g `pinnacle@duxton` +* Names can include numbers. e.g `Block71` +* Names must include at least one alphanumeric character. +* Valid clean statuses is case-insensitive, e.g `c/Y` is the same as `c/y`, `c/clean` is the same as `c/ClEaN`. +* Address can contain any alphanumeric character and symbols. `@!df34!@//` is considered a valid address. +* Tags should only contain alphanumeric characters, symbols and spaces are not valid. -
:bulb: **Tip:** -A person can have any number of tags (including 0) -
+Format: ` add n/RESIDENCE_NAME a/ADDRESS [c/VALID_CLEAN_STATUS] [t/TAG]... ` 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` +* `add n/Melville Park a/22 Simei Street 1, #10-02, S529948` +* `add n/Clementi HDB a/459A Clementi Ave 3, #04-257, S121459 c/n` -### Listing all persons : `list` +### Listing all residences: `list` -Shows a list of all persons in the address book. +Shows a list of all residences in the app. Format: `list` -### Editing a person : `edit` +* The displayed list of residences will be sorted by their clean status. +* Unclean residences come before clean residences. -Edits an existing person in the address book. +### Listing residences with bookings starting in the next 7 days: `remind` -Format: `edit INDEX [n/NAME] [p/PHONE] [e/EMAIL] [a/ADDRESS] [t/TAG]…​` +Shows a list of all residences with bookings starting in the next 7 days. -* 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. +Format: `remind` + +* Next 7 days: If today is 1st April, residences with bookings starting on 2nd April to 8th April (inclusive) will be listed. +* The displayed list of residences is always sorted. +* Unclean residences come before clean residences. + +### Editing a residence: `edit` + +Edits the given fields of an existing residence (excludes bookings, see `editb` instead to edit bookings). + +Format: `edit RESIDENCE_INDEX [n/RESIDENCE_NAME] [a/ADDRESS] [c/VALID_CLEAN_STATUS] [t/TAG]` + +* Edits the residence at the specified `RESIDENCE_INDEX`. +* The `RESIDENCE_INDEX` refers to the index number shown in the displayed residence list(i.e. **NOT** zero-indexed, items start at index 1). +* The `RESIDENCE_INDEX` **must be a positive integer** 1, 2, 3, …​ +* At least one field must be provided. +* If this command is used to edit tags, all tags for this residence need to be specified. +* Address can contain any alphanumeric character and symbols. `@!df34!@//` is considered a valid address. +* Valid clean statuses is case-insensitive, e.g `c/Y` is the same as `c/y`, `c/clean` is the same as `c/ClEaN`. +* Tags should only contain alphanumeric characters, symbols and spaces are not valid. +* Editing of tags overwrites all existing tags. 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. +* `edit 1 c/y` Edits the clean status of the 1st residence on the list to `Clean`. +* `edit 2 n/Nashville` Edits the name of the 2nd residence on the list from to `Nashville`. +* `edit 1 t/tag1 t/tag2` Edits the 1st residence on the list to have tags `tag1` and `tag2`. -### Locating persons by name: `find` +### Locating residences by name: `find` -Finds persons whose names contain any of the given keywords. +Finds residences whose names contain any of the given keywords. -Format: `find KEYWORD [MORE_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` +* The search is case-insensitive. e.g `duxton` will match `Duxton` +* The order of the keywords does not matter. e.g. `Gardens Bay` will match `Bay Gardens` * 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` +* Only full words will be matched e.g. `Dux` will not match `Duxton` +* Apartments matching at least one keyword will be returned (i.e. `OR` search). + e.g. `Gardens Bay` will return `Botanic Gardens`, `Bay Area` Examples: -* `find John` returns `john` and `John Doe` -* `find alex david` returns `Alex Yeoh`, `David Li`
- ![result for 'find alex david'](images/findAlexDavidResult.png) +* `find heights` returns `Hillview Heights` and `Aspen Heights` +* `find east coast` returns `East View`, `West Coast`
-### Deleting a person : `delete` +### Deleting a residence: `delete` -Deletes the specified person from the address book. +Deletes the specified residence from the list of residences shown. -Format: `delete INDEX` +Format: `delete RESIDENCE_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, …​ +* Deletes the residence at the specified `RESIDENCE_INDEX`. +* The `RESIDENCE_INDEX` refers to the index number shown in the displayed residences list (i.e. **NOT** zero-indexed, items start at index 1). +* The `RESIDENCE_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. +* `list` followed by `delete 3` deletes the 3rd residence in the list of residences shown. + +### Update multiple Clean status: `status` + +Update Clean status of multiple residences at once. + +Format: `status clean RESIDENCE_INDEX1 RESIDENCE_INDEX2..` or `status unclean RESIDENCE_INDEX1 RESIDENCE_INDEX2..` + +* Updates the clean status of the residences' with the specified `RESIDENCE_INDEX`. +* The `RESIDENCE_INDEX` refers to the index number shown in the displayed residences list (i.e. **NOT** zero-indexed, items start at index 1). +* The `RESIDENCE_INDEX` must be a **positive integer** 1, 2, 3, …​ +* More than 1 residence indexes can be specified. +* After updating, the residence list will sort automatically to show Unclean residences before the clean residences. + +Examples: +* `status clean 1 3` update the 1st and 3rd residences clean status to `Clean`. +* `status unclean 2 5` update the 2nd and 5th residences clean status to `Unclean`. + ### Clearing all entries : `clear` -Clears all entries from the address book. +Clears all entries from the residence tracker. Format: `clear` +### Adding a booking: `addb` + +Adds a new booking to the specified residence. + +Format: `addb RESIDENCE_INDEX n/NAME_OF_TENANT p/PHONE_OF_TENANT s/START_DATE e/END_DATE` + +* Adds a booking to the residence at the specified `RESIDENCE_INDEX`. +* The `RESIDENCE_INDEX` refers to the index number shown in the displayed residences list (i.e. **NOT** zero-indexed). +* The `RESIDENCE_INDEX` must be a **positive integer** 1, 2, 3, …​ +* The phone must only include numbers and must be at least 3 characters long. e.g `p/999` `p/12345678` +* The dates must follow the format DD-MM-YYYY. e.g `s/01-02-2021` +* It is invalid to edit the `START_DATE` to be later than the `END_DATE`. Likewise, it is invalid to update the `END_DATE` + to be earlier than the `START_DATE`. +* It is invalid to edit `START_DATE` or `END_DATE` such that it overlaps with dates of other bookings. +* Existing values will be updated to the input values. + +Examples: +* `addb 1 n/John p/91234567 s/01-01-2021 e/02-01-2021` +* `addb 2 n/Jane Tan p/65812567 s/31-12-2021 e/05-01-2022` + +### Deleting a booking from a residence: `deleteb` + +Deletes the specified booking from the specified residence. + +Format: `deleteb r/RESIDENCE_INDEX b/BOOKING_INDEX` + +* Deletes the booking at the specified `BOOKING_INDEX` from the residence at the specified `RESIDENCE_INDEX` +* `RESIDENCE_INDEX` and `BOOKING_INDEX` refers to the index number as shown in ResidenceTracker (i.e. **NOT** zero-indexed, items start at index 1). +* `RESIDENCE_INDEX` and `BOOKING_INDEX` must be **positive integer** 1, 2, 3, …​ + +Examples: +* `list` followed by `deleteb r/3 b/2` deletes the 2nd booking from the 3rd residence. + +### Editing a booking: `editb` + +Edits the specified booking from the specified residence. + +Format: `editb r/RESIDENCE_INDEX b/BOOKING_INDEX [n/TENANT_NAME] [p/PHONE] [s/START_DATE] [e/END_DATE]` + +* `RESIDENCE_INDEX` and `BOOKING_INDEX` refers to the index number as shown in ResidenceTracker (i.e. **NOT** zero-indexed, items start at index 1). +* `RESIDENCE_INDEX` and `BOOKING_INDEX` must be **positive integer** 1, 2, 3, …​ +* At least one of the optional fields must be provided. +* It is invalid to edit the `START_DATE` to be later than the `END_DATE`. Likewise, it is invalid to update the `END_DATE` +to be earlier than the `START_DATE`. +* It is invalid to edit `START_DATE` or `END_DATE` such that it overlaps with dates of other bookings. +* Existing values will be updated to the input values. + +Examples: +* `editb r/1 b/2 p/90069009 s/03-28-2021` Edits the phone number and start date of 2nd booking of the 1st residence to be +`90069009` and `03-28-2021` respectively. + ### Exiting the program : `exit` Exits the program. @@ -156,14 +244,14 @@ 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. +ResidenceTracker data are saved in the hard disk automatically after any command that changes the data. There is no need to save manually. ### Editing the data file -AddressBook data are saved as a JSON file `[JAR file location]/data/addressbook.json`. Advanced users are welcome to update data directly by editing that data file. +ResidenceTracker data are saved as a JSON file `[JAR file location]/data/residencetracker.json`. Advanced users are welcome to update data directly by editing that data file.
:exclamation: **Caution:** -If your changes to the data file makes its format invalid, AddressBook will discard all data and start with an empty data file at the next run. +If your changes to the data file makes its format invalid, ResidenceTracker will discard all data and start with an empty data file at the next run.
### Archiving data files `[coming in v2.0]` @@ -175,7 +263,7 @@ _Details coming soon ..._ ## FAQ **Q**: How do I transfer my data to another Computer?
-**A**: Install the app in the other computer and overwrite the empty data file it creates with the file that contains the data of your previous AddressBook home folder. +**A**: Install the app in the other computer and overwrite the empty data file it creates with the file that contains the data of your previous ResidenceTracker home folder. -------------------------------------------------------------------------------------------------------------------- @@ -183,10 +271,16 @@ _Details coming soon ..._ 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` +**Add Residence** | `add n/NAME_OF_RESIDENCE a/ADDRESS [clean/[y or n]] [t/TAG] …​`
e.g., `add n/Clementi HDB a/459A Clementi Ave 3, #04-257, S121459 clean/n` +**Add Booking to Residence** | `addb RESIDENCE_INDEX n/NAME_OF_BOOKER p/PHONE_OF_BOOKER s/START_TIME e/END_TIME`
e.g., `add 2 n/John a/91234567 s/01-01-2021 e/02-01-2021` +**Delete Residence** | `delete INDEX`
e.g., `delete 3` +**Delete Booking of Residence** | `deleteb r/RESIDENCE_INDEX b/BOOKING_INDEX`
e.g., `delete r/3 b/2` +**Edit Residence** | `edit INDEX [n/RESIDENCE_NAME] [a/ADDRESS] [c/VALID_CLEAN_STATUS] [t/TAG]`
e.g.,`edit 2 c/n` +**Edit Booking of Residence** | `editb r/RESIDENCE_INDEX b/BOOKING_INDEX [n/TENANT_NAME] [p/PHONE] [s/START_DATE] [e/END_DATE]`
e.g., `editb r/1 b/2 p/90069009 s/03-28-2021` +**Update Multiple Clean Status** | `status clean INDEX1 INDEX2..` or `status unclean INDEX1 INDEX2..`
e.g., `status clean 1 3` +**Find Residence** | `find KEYWORD [MORE_KEYWORDS]`
e.g., `find Heights` +**Remind Residences with Upcoming Bookings** | `remind` +**List All Residences** | `list` **Help** | `help` +**Exit** | `exit` +**Clear** | `clear` diff --git a/docs/_config.yml b/docs/_config.yml index 6bd245d8f4e..29fc3f25fd4 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -1,4 +1,4 @@ -title: "AB-3" +title: "ResidenceTracker" theme: minima header_pages: @@ -8,7 +8,7 @@ header_pages: markdown: kramdown -repository: "se-edu/addressbook-level3" +repository: "AY2021S2-CS2103T-T16-3/tp" github_icon: "images/github-icon.png" plugins: diff --git a/docs/diagrams/ArchitectureSequenceDiagram.puml b/docs/diagrams/ArchitectureSequenceDiagram.puml index ef81d18c337..726500d0697 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 : deleteResidence(Residence) activate model MODEL_COLOR model -[MODEL_COLOR]-> logic deactivate model -logic -[LOGIC_COLOR]> storage : saveAddressBook(addressBook) +logic -[LOGIC_COLOR]> storage : saveResidenceTracker(ResidenceTracker) 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..d519440b290 100644 --- a/docs/diagrams/BetterModelClassDiagram.puml +++ b/docs/diagrams/BetterModelClassDiagram.puml @@ -4,18 +4,24 @@ 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 +ResidenceTracker *-right-> "1" UniqueResidenceList +ResidenceTracker *-right-> "1" UniqueTagList +UniqueTagList -[hidden]down- UniqueResidenceList +UniqueTagList -[hidden]down- UniqueResidenceList UniqueTagList *-right-> "*" Tag -UniquePersonList o-right-> Person +UniqueResidenceList o-right-> Residence -Person -up-> "*" Tag +Residence -up-> "*" Tag + +Residence *-->"1" ResidenceName +Residence *--> "1"ResidenceAddress +Residence *--> "1" CleanStatusTag +Residence *--> "1"BookingList + +BookingList *-->"*" Booking +Booking *--> TenantName +Booking *--> Phone +Booking *--> BookingTime -Person *--> Name -Person *--> Phone -Person *--> Email -Person *--> Address @enduml diff --git a/docs/diagrams/CommitActivityDiagram.puml b/docs/diagrams/CommitActivityDiagram.puml index 6a6b23a006f..59fae658c36 100644 --- a/docs/diagrams/CommitActivityDiagram.puml +++ b/docs/diagrams/CommitActivityDiagram.puml @@ -5,10 +5,10 @@ start '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]) +if () then ([command commits ResidenceTracker]) :Purge redundant states; - :Save AddressBook to - addressBookStateList; + :Save ResidenceTracker to + residenceTrackerStateList; else ([else]) endif stop diff --git a/docs/diagrams/DeleteSequenceDiagram.puml b/docs/diagrams/DeleteSequenceDiagram.puml index 1dc2311b245..b8f6073b7aa 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 ":ResidenceTrackerParser" as ResidenceTrackerParser 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 -> ResidenceTrackerParser : parseCommand("delete 1") +activate ResidenceTrackerParser create DeleteCommandParser -AddressBookParser -> DeleteCommandParser +ResidenceTrackerParser -> DeleteCommandParser activate DeleteCommandParser -DeleteCommandParser --> AddressBookParser +DeleteCommandParser --> ResidenceTrackerParser deactivate DeleteCommandParser -AddressBookParser -> DeleteCommandParser : parse("1") +ResidenceTrackerParser -> DeleteCommandParser : parse("1") activate DeleteCommandParser create DeleteCommand @@ -36,19 +36,19 @@ activate DeleteCommand DeleteCommand --> DeleteCommandParser : d deactivate DeleteCommand -DeleteCommandParser --> AddressBookParser : d +DeleteCommandParser -->ResidenceTrackerParser : d deactivate DeleteCommandParser 'Hidden arrow to position the destroy marker below the end of the activation bar. -DeleteCommandParser -[hidden]-> AddressBookParser +DeleteCommandParser -[hidden]-> ResidenceTrackerParser destroy DeleteCommandParser -AddressBookParser --> LogicManager : d -deactivate AddressBookParser +ResidenceTrackerParser --> LogicManager : d +deactivate ResidenceTrackerParser LogicManager -> DeleteCommand : execute() activate DeleteCommand -DeleteCommand -> Model : deletePerson(1) +DeleteCommand -> Model : deleteResidence(Residence) activate Model Model --> DeleteCommand diff --git a/docs/diagrams/LogicClassDiagram.puml b/docs/diagrams/LogicClassDiagram.puml index 50d8aff17a1..755308ea384 100644 --- a/docs/diagrams/LogicClassDiagram.puml +++ b/docs/diagrams/LogicClassDiagram.puml @@ -8,7 +8,7 @@ package Logic { package Parser { Interface Parser <> -Class AddressBookParser +Class ResidenceTrackerParser Class XYZCommandParser Class CliSyntax Class ParserUtil @@ -39,8 +39,8 @@ Class HiddenOutside #FFFFFF HiddenOutside ..> Logic LogicManager .up.|> Logic -LogicManager -->"1" AddressBookParser -AddressBookParser .left.> XYZCommandParser: creates > +LogicManager -->"1" ResidenceTrackerParser +ResidenceTrackerParser .left.> XYZCommandParser: creates > XYZCommandParser ..> XYZCommand : creates > XYZCommandParser .left.|> Parser diff --git a/docs/diagrams/ModelClassDiagram.puml b/docs/diagrams/ModelClassDiagram.puml index 3eae5326a82..19a24c3a4a8 100644 --- a/docs/diagrams/ModelClassDiagram.puml +++ b/docs/diagrams/ModelClassDiagram.puml @@ -5,23 +5,23 @@ skinparam arrowColor MODEL_COLOR skinparam classBackgroundColor MODEL_COLOR Package Model <>{ -Interface ReadOnlyAddressBook <> +Interface ReadOnlyResidenceTracker <> Interface Model <> Interface ObservableList <> -Class AddressBook -Class ReadOnlyAddressBook +Class ResidenceTracker +Class ReadOnlyResidenceTracker Class Model Class ModelManager Class UserPrefs Class ReadOnlyUserPrefs -Package Person { -Class Person -Class Address -Class Email -Class Name -Class Phone -Class UniquePersonList +Package Residence { +Class Residence +Class ResidenceAddress +Class ResidenceName +Class CleanStatusTag +Class BookingList +Class UniqueResidenceList } Package Tag { @@ -32,25 +32,25 @@ Class Tag Class HiddenOutside #FFFFFF HiddenOutside ..> Model -AddressBook .up.|> ReadOnlyAddressBook +ResidenceTracker .up.|> ReadOnlyResidenceTracker ModelManager .up.|> Model Model .right.> ObservableList -ModelManager o--> "1" AddressBook +ModelManager o--> "1" ResidenceTracker ModelManager o-left-> "1" UserPrefs UserPrefs .up.|> ReadOnlyUserPrefs -AddressBook *--> "1" UniquePersonList -UniquePersonList o--> "*" Person -Person *--> Name -Person *--> Phone -Person *--> Email -Person *--> Address -Person *--> "*" Tag +ResidenceTracker *--> "1" UniqueResidenceList +UniqueResidenceList o--> "*" Residence +Residence *--> ResidenceName +Residence *--> ResidenceAddress +Residence *--> CleanStatusTag +Residence *--> BookingList +Residence *--> "*" Tag -Name -[hidden]right-> Phone -Phone -[hidden]right-> Address -Address -[hidden]right-> Email +ResidenceName -[hidden]right-> ResidenceAddress +ResidenceAddress -[hidden]right-> CleanStatusTag +CleanStatusTag -[hidden]right-> BookingList -ModelManager ----->" ~* filtered list" Person +ModelManager ----->" ~* filtered list" Residence @enduml diff --git a/docs/diagrams/StorageClassDiagram.puml b/docs/diagrams/StorageClassDiagram.puml index a200d532529..912433fa007 100644 --- a/docs/diagrams/StorageClassDiagram.puml +++ b/docs/diagrams/StorageClassDiagram.puml @@ -6,22 +6,23 @@ skinparam classBackgroundColor STORAGE_COLOR Interface Storage <> Interface UserPrefsStorage <> -Interface AddressBookStorage <> +Interface ResidenceTrackerStorage <> Class StorageManager Class JsonUserPrefsStorage -Class JsonAddressBookStorage +Class JsonResidenceTrackerStorage StorageManager .left.|> Storage StorageManager o-right-> UserPrefsStorage -StorageManager o--> AddressBookStorage +StorageManager o--> ResidenceTrackerStorage Storage -|> UserPrefsStorage -Storage -|> AddressBookStorage +Storage -|> ResidenceTrackerStorage JsonUserPrefsStorage .left.|> UserPrefsStorage -JsonAddressBookStorage .left.|> AddressBookStorage -JsonAddressBookStorage .down.> JsonSerializableAddressBook -JsonSerializableAddressBook .right.> JsonAdaptedPerson -JsonAdaptedPerson .right.> JsonAdaptedTag +JsonResidenceTrackerStorage .left.|> ResidenceTrackerStorage +JsonResidenceTrackerStorage .down.> JsonSerializableResidenceTracker +JsonSerializableResidenceTracker .right.> JsonAdaptedResidence +JsonAdaptedResidence .right.> JsonAdaptedTag +JsonAdaptedResidence .up.> JsonAdaptedBooking @enduml diff --git a/docs/diagrams/UiClassDiagram.puml b/docs/diagrams/UiClassDiagram.puml index 92746f9fcf7..b6d81b8eaeb 100644 --- a/docs/diagrams/UiClassDiagram.puml +++ b/docs/diagrams/UiClassDiagram.puml @@ -11,8 +11,8 @@ Class UiManager Class MainWindow Class HelpWindow Class ResultDisplay -Class PersonListPanel -Class PersonCard +Class ResidenceListPanel +Class ResidenceCard Class StatusBarFooter Class CommandBox } @@ -33,25 +33,25 @@ UiManager -down-> MainWindow MainWindow --> HelpWindow MainWindow *-down-> CommandBox MainWindow *-down-> ResultDisplay -MainWindow *-down-> PersonListPanel +MainWindow *-down-> ResidenceListPanel MainWindow *-down-> StatusBarFooter -PersonListPanel -down-> PersonCard +ResidenceListPanel -down-> ResidenceCard MainWindow -left-|> UiPart ResultDisplay --|> UiPart CommandBox --|> UiPart -PersonListPanel --|> UiPart -PersonCard --|> UiPart +ResidenceListPanel --|> UiPart +ResidenceCard --|> UiPart StatusBarFooter --|> UiPart HelpWindow -down-|> UiPart -PersonCard ..> Model +ResidenceCard ..> Model UiManager -right-> Logic MainWindow -left-> Logic -PersonListPanel -[hidden]left- HelpWindow +ResidenceListPanel -[hidden]left- HelpWindow HelpWindow -[hidden]left- CommandBox CommandBox -[hidden]left- ResultDisplay ResultDisplay -[hidden]left- StatusBarFooter diff --git a/docs/diagrams/UndoSequenceDiagram.puml b/docs/diagrams/UndoSequenceDiagram.puml index 410aab4e412..4183d72f4f9 100644 --- a/docs/diagrams/UndoSequenceDiagram.puml +++ b/docs/diagrams/UndoSequenceDiagram.puml @@ -3,42 +3,42 @@ box Logic LOGIC_COLOR_T1 participant ":LogicManager" as LogicManager LOGIC_COLOR -participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR +participant ":VersionedResidenceTracker" as VersionedResidenceTracker 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 +participant ":VersionedResidenceTracker" as VersionedResidenceTracker MODEL_COLOR end box [-> LogicManager : execute(undo) activate LogicManager -LogicManager -> AddressBookParser : parseCommand(undo) -activate AddressBookParser +LogicManager -> ResidenceTrackerParser : parseCommand(undo) +activate ResidenceTrackerParser create UndoCommand -AddressBookParser -> UndoCommand +ResidenceTrackerParser -> UndoCommand activate UndoCommand -UndoCommand --> AddressBookParser +UndoCommand --> ResidenceTrackerParser deactivate UndoCommand -AddressBookParser --> LogicManager : u -deactivate AddressBookParser +ResidenceTrackerParser --> LogicManager : u +deactivate ResidenceTrackerParser LogicManager -> UndoCommand : execute() activate UndoCommand -UndoCommand -> Model : undoAddressBook() +UndoCommand -> Model : undoResidenceTracker() activate Model -Model -> VersionedAddressBook : undo() -activate VersionedAddressBook +Model -> VersionedResidenceTracker : undo() +activate VersionedResidenceTracker -VersionedAddressBook -> VersionedAddressBook :resetData(ReadOnlyAddressBook) -VersionedAddressBook --> Model : -deactivate VersionedAddressBook +VersionedResidenceTracker -> VersionedResidenceTracker :resetData(ReadOnlyResidenceTracker) +VersionedResidenceTracker --> Model : +deactivate VersionedResidenceTracker Model --> UndoCommand deactivate Model diff --git a/docs/diagrams/plantuml/AbeforeC.png b/docs/diagrams/plantuml/AbeforeC.png new file mode 100644 index 00000000000..5d60025e528 Binary files /dev/null and b/docs/diagrams/plantuml/AbeforeC.png differ diff --git a/docs/diagrams/plantuml/AllDown.png b/docs/diagrams/plantuml/AllDown.png new file mode 100644 index 00000000000..bb5caa4737c Binary files /dev/null and b/docs/diagrams/plantuml/AllDown.png differ diff --git a/docs/diagrams/plantuml/ArrowLength.png b/docs/diagrams/plantuml/ArrowLength.png new file mode 100644 index 00000000000..a6f8b4e5f08 Binary files /dev/null and b/docs/diagrams/plantuml/ArrowLength.png differ diff --git a/docs/diagrams/plantuml/CbeforeA.png b/docs/diagrams/plantuml/CbeforeA.png new file mode 100644 index 00000000000..6fed2f8a1c3 Binary files /dev/null and b/docs/diagrams/plantuml/CbeforeA.png differ diff --git a/docs/diagrams/plantuml/HiddenArrows.png b/docs/diagrams/plantuml/HiddenArrows.png new file mode 100644 index 00000000000..8eb1605927e Binary files /dev/null and b/docs/diagrams/plantuml/HiddenArrows.png differ diff --git a/docs/diagrams/plantuml/PackagesAndConsistency.png b/docs/diagrams/plantuml/PackagesAndConsistency.png new file mode 100644 index 00000000000..f70464b7a7c Binary files /dev/null and b/docs/diagrams/plantuml/PackagesAndConsistency.png differ diff --git a/docs/diagrams/plantuml/UpAndDown.png b/docs/diagrams/plantuml/UpAndDown.png new file mode 100644 index 00000000000..9ceb4d0ee08 Binary files /dev/null and b/docs/diagrams/plantuml/UpAndDown.png differ diff --git a/docs/diagrams/tracing/LogicSequenceDiagram.png b/docs/diagrams/tracing/LogicSequenceDiagram.png new file mode 100644 index 00000000000..46f81cc164c Binary files /dev/null and b/docs/diagrams/tracing/LogicSequenceDiagram.png differ diff --git a/docs/diagrams/tracing/LogicSequenceDiagram.puml b/docs/diagrams/tracing/LogicSequenceDiagram.puml index fdcbe1c0ccc..05d97f0cd3b 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 ":ResidenceTrackerParser" 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, editResidenceDescriptor ec --> ecp -- ecp --> abp --: command abp --> logic --: command diff --git a/docs/images/ArchitectureSequenceDiagram.png b/docs/images/ArchitectureSequenceDiagram.png index 2f1346869d0..3a07a2be6b3 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..7ff44d5b37d 100644 Binary files a/docs/images/BetterModelClassDiagram.png and b/docs/images/BetterModelClassDiagram.png differ diff --git a/docs/images/CommitActivityDiagram.png b/docs/images/CommitActivityDiagram.png index c08c13f5c8b..0743e788b54 100644 Binary files a/docs/images/CommitActivityDiagram.png and b/docs/images/CommitActivityDiagram.png differ diff --git a/docs/images/DeleteSequenceDiagram.png b/docs/images/DeleteSequenceDiagram.png index fa327b39618..9afa458ba95 100644 Binary files a/docs/images/DeleteSequenceDiagram.png and b/docs/images/DeleteSequenceDiagram.png differ diff --git a/docs/images/LogicClassDiagram.png b/docs/images/LogicClassDiagram.png index e434feaf5b8..8a84011a511 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 ffd17662d41..4bd1dca8c1d 100644 Binary files a/docs/images/ModelClassDiagram.png and b/docs/images/ModelClassDiagram.png differ diff --git a/docs/images/StatusActivityDiagram.png b/docs/images/StatusActivityDiagram.png new file mode 100644 index 00000000000..fb03dc27d6b Binary files /dev/null and b/docs/images/StatusActivityDiagram.png differ diff --git a/docs/images/StatusSequenceDiagram.png b/docs/images/StatusSequenceDiagram.png new file mode 100644 index 00000000000..dc1cd2219ce Binary files /dev/null and b/docs/images/StatusSequenceDiagram.png differ diff --git a/docs/images/StorageClassDiagram.png b/docs/images/StorageClassDiagram.png index c7297c26887..6487d7fe365 100644 Binary files a/docs/images/StorageClassDiagram.png and b/docs/images/StorageClassDiagram.png differ diff --git a/docs/images/Ui.png b/docs/images/Ui.png index 5bd77847aa2..45437b8908c 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..dd7773a25a7 100644 Binary files a/docs/images/UiClassDiagram.png and b/docs/images/UiClassDiagram.png differ diff --git a/docs/images/awzhenyi.png b/docs/images/awzhenyi.png new file mode 100644 index 00000000000..fb84c016459 Binary files /dev/null and b/docs/images/awzhenyi.png differ diff --git a/docs/images/helpMessage.png b/docs/images/helpMessage.png index b1f70470137..a7a5a089e9f 100644 Binary files a/docs/images/helpMessage.png and b/docs/images/helpMessage.png differ diff --git a/docs/images/jaredtengsw.png b/docs/images/jaredtengsw.png new file mode 100644 index 00000000000..ca1038feab2 Binary files /dev/null and b/docs/images/jaredtengsw.png differ diff --git a/docs/images/vrsoorya.png b/docs/images/vrsoorya.png new file mode 100644 index 00000000000..70fd636f58c Binary files /dev/null and b/docs/images/vrsoorya.png differ diff --git a/docs/images/wangtao0717.png b/docs/images/wangtao0717.png new file mode 100644 index 00000000000..9accccb1216 Binary files /dev/null and b/docs/images/wangtao0717.png differ diff --git a/docs/images/whatthelump.png b/docs/images/whatthelump.png new file mode 100644 index 00000000000..7a1c0beb9ea Binary files /dev/null and b/docs/images/whatthelump.png differ diff --git a/docs/index.md b/docs/index.md index 7601dbaad0d..892590d507c 100644 --- a/docs/index.md +++ b/docs/index.md @@ -4,7 +4,7 @@ title: AddressBook Level-3 --- [![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) +[![codecov](https://codecov.io/gh/AY2021S2-CS2103-T16-3/tp/branch/master/graph/badge.svg?token=U5L6JM6HMZ)](https://codecov.io/gh/AY2021S2-CS2103-T16-3/tp) ![Ui](images/Ui.png) diff --git a/docs/team/awzhenyi.md b/docs/team/awzhenyi.md new file mode 100644 index 00000000000..dcbf6652e2d --- /dev/null +++ b/docs/team/awzhenyi.md @@ -0,0 +1,39 @@ +--- +layout: page +title: Zhen Yi's Project Portfolio Page +--- + +## Project: Residence Tracker + +ResidenceTracker (RT) is a **desktop app for managing residences, 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, RT can get your residence management tasks done faster than traditional GUI apps. + +Given below are my contributions to the project. + +* **New Feature**: Edit Booking. + * What it does: allows user to edit the details of an existing booking. + * Justification: This feature improves the product since bookings are always subjected to changes such as postponements, additional day of booking, late estimated arrivals, etc. By + allowing the user to edit the details the of the bookings, it helps to smoothen the process of updating information. + +* **New Feature**: Delete Booking + * What it does: allows user to delete an existing booking. + * Justification: This feature improves the product by allowing the user to delete bookings that are expired, or cancelled so that the bookings column will not be cluttered with nonessential information. + +* **Code contributed**: [RepoSense link](https://nus-cs2103-ay2021s2.github.io/tp-dashboard/?search=awzhenyi&sort=groupTitle&sortWithin=title&timeframe=commit&mergegroup=&groupSelect=groupByRepos&breakdown=true&checkedFileTypes=docs~functional-code~test-code~other&since=2021-02-19&tabOpen=true&tabType=authorship&tabAuthor=awzhenyi&tabRepo=AY2021S2-CS2103-T16-3%2Ftp%5Bmaster%5D&authorshipIsMergeGroup=false&authorshipFileTypes=docs~functional-code~test-code&authorshipIsBinaryFileTypeChecked=false) + +* **Project management**: + * Opening of Github Issues and assignment. + * Practice of forking workflow. + +* **Enhancements to existing features**: + * TBD + +* **Documentation**: + * User Guide: + * Added documentation for the features `editb` [\#163](https://github.com/AY2021S2-CS2103-T16-3/tp/pull/163) + * Added documentation for the features `deteteb` [\#120](https://github.com/AY2021S2-CS2103-T16-3/tp/pull/120/) + * Developer Guide: + * Added implementation details of the `editb` feature. + +* **Community**: + * PRs reviewed (with non-trivial review comments): [\#161](https://github.com/AY2021S2-CS2103-T16-3/tp/pull/161) + * Reported bugs and suggestions for other teams in the class as part of practical dry run. (https://github.com/awzhenyi/ped/issues) diff --git a/docs/team/vrsoorya.md b/docs/team/vrsoorya.md new file mode 100644 index 00000000000..7333f0ed0e7 --- /dev/null +++ b/docs/team/vrsoorya.md @@ -0,0 +1,47 @@ +--- +layout: page +title: John Doe's Project Portfolio Page +NOTE: to be edited by Soorya accordingly as development progresses +--- + +## 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/wangtao0717.md b/docs/team/wangtao0717.md new file mode 100644 index 00000000000..0a9ce1dedd0 --- /dev/null +++ b/docs/team/wangtao0717.md @@ -0,0 +1,48 @@ +--- +layout: page +title: Wang Tao's Project Portfolio Page +NOTE: to be edited by Wang Tao accordingly as development progresses +--- + +## Project: Residence Tracker + +ResidenceTracker (RT) 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, RT can get your residence management tasks done faster than traditional GUI apps. + +Given below are my contributions to the project. + +* **New Feature**: a new feature of residence -- cleanStatusTag + * What it is: A remarkable sign to show the clean status of residence which help users clearly know whether the residence is clean or not, and arrange for home cleaning company to provide service in time. + * Justification: This feature improves the product significantly because as airbnb managers, they could manage the residences more conveniently with the help of this feature and avoid complaints caused by poor cleanup. + * Highlights: cleanStatusTag as a residence feature is applied to all aspects of the project. "add"and "edit" command can initialize and change it. + +* **New Feature**: new command "status" + * What it is: a convenient command to update clean status of multiple residences. + * Justification: This feature improves the product significantly because clean status is a special tag which is changed often, and after users call someone to clean residences, it usually needs to update more than one clean status. as busy managers, they definitely don’t want to waste time updating them one by one. So this command can save users' time. + * Highlights: cleanStatusTag as a residence feature is applied to all aspects of the project. "add"and "edit" command can initialize and change it. + +* **Code contributed**: [RepoSense link](https://nus-cs2103-ay2021s2.github.io/tp-dashboard/?search=&sort=groupTitle&sortWithin=title&timeframe=commit&mergegroup=&groupSelect=groupByRepos&breakdown=true&checkedFileTypes=docs~functional-code~test-code~other&since=&tabOpen=true&tabType=authorship&tabAuthor=wangtao0717&tabRepo=AY2021S2-CS2103-T16-3%2Ftp%5Bmaster%5D&authorshipIsMergeGroup=false&authorshipFileTypes=docs~functional-code~test-code&authorshipIsBinaryFileTypeChecked=false) + +* **Project management**: + * Pull and set up the GitHub team org/repo + * Maintaining the issue tracker + +* **Enhancements to existing features**: + * Updated the GUI background image and color (Pull requests [\#70](https://github.com/AY2021S2-CS2103-T16-3/tp/pull/70), [\#75](https://github.com/AY2021S2-CS2103-T16-3/tp/pull/75)) + * Wrote tests for new features to increase coverage (Pull requests [\#80](https://github.com/AY2021S2-CS2103-T16-3/tp/pull/80), [\#109](https://github.com/AY2021S2-CS2103-T16-3/tp/pull/109)) + * fix some failing tests (Pull requests [\#226](https://github.com/AY2021S2-CS2103-T16-3/tp/pull/226)) + +* **Documentation**: + * User Guide: + * Added documentation for the features `add` [\#20](https://github.com/AY2021S2-CS2103-T16-3/tp/pull/20) + * Added documentation for the features `status` [\#171](https://github.com/AY2021S2-CS2103-T16-3/tp/pull/171) + * Did cosmetic tweaks to existing documentation: [\#224](https://github.com/AY2021S2-CS2103-T16-3/tp/pull/224) + * Developer Guide: + * Added use case.[\#35](https://github.com/AY2021S2-CS2103-T16-3/tp/pull/35) + * Added implementation details of the `status` feature [\#226](https://github.com/AY2021S2-CS2103-T16-3/tp/pull/226) + * Added `StatusSequenceDiagram` UML + +* **Community**: + * PRs reviewed (with non-trivial review comments): [\#229](https://github.com/AY2021S2-CS2103-T16-3/tp/pull/229) + + + diff --git a/docs/tutorials/AddRemark.md b/docs/tutorials/AddRemark.md deleted file mode 100644 index 64c9b1f91de..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 a `CommandException` to accurately reflect that our command is still a work in progress. - -![The relationship between RemarkCommand and Command](../images/add-remark/CommandInterface.png) - -Following the convention in other commands, we add relevant messages as constants and use them. - -**`RemarkCommand.java`:** - -``` java - public static final String MESSAGE_USAGE = COMMAND_WORD + ": Edits the remark of the person identified " - + "by the index number used in the last person listing. " - + "Existing remark will be overwritten by the input.\n" - + "Parameters: INDEX (must be a positive integer) " - + "r/ [REMARK]\n" - + "Example: " + COMMAND_WORD + " 1 " - + "r/ Likes to swim."; - - public static final String MESSAGE_NOT_IMPLEMENTED_YET = "Remark command not implemented yet"; - - @Override - public CommandResult execute(Model model) throws CommandException { - throw new CommandException(MESSAGE_NOT_IMPLEMENTED_YET); - } -``` - -## Enhancing `RemarkCommand` - -Let’s change `RemarkCommand` to parse input from the user. - -### Make the command accept parameters - -We start by modifying the constructor of `RemarkCommand` to accept an `Index` and a `String`. While we are at it, let’s change the error message to echo the values. While this is not a replacement for tests, it is an obvious way to tell if our code is functioning as intended. - -``` java -import static seedu.address.commons.util.CollectionUtil.requireAllNonNull; -//... -public class RemarkCommand extends Command { - //... - public static final String MESSAGE_ARGUMENTS = "Index: %1$d, Remark: %2$s"; - - private final Index index; - private final String remark; - - /** - * @param index of the person in the filtered person list to edit the remark - * @param remark of the person to be updated to - */ - public RemarkCommand(Index index, String remark) { - requireAllNonNull(index, remark); - - this.index = index; - this.remark = remark; - } - @Override - public CommandResult execute(Model model) throws CommandException { - throw new CommandException(String.format(MESSAGE_ARGUMENTS, index.getOneBased(), remark)); - } - - @Override - public boolean equals(Object other) { - // short circuit if same object - if (other == this) { - return true; - } - - // instanceof handles nulls - if (!(other instanceof RemarkCommand)) { - return false; - } - - // state check - RemarkCommand e = (RemarkCommand) other; - return index.equals(e.index) - && remark.equals(e.remark); - } -} -``` - -Your code should look something like [this](https://github.com/se-edu/addressbook-level3/commit/35eb7286f18a029d39cb7a29df8f172a001e4fd8#diff-34ace715a8a8d2e5a66e71289f017b47) after you are done. - -### Parse user input - -Now let’s move on to writing a parser that will extract the index and remark from the input provided by the user. - -Create a `RemarkCommandParser` class in the `seedu.address.logic.parser` package. The class must extend the `Parser` interface. - -![The relationship between Parser and RemarkCommandParser](../images/add-remark/ParserInterface.png) - -Thankfully, `ArgumentTokenizer#tokenize()` makes it trivial to parse user input. Let’s take a look at the JavaDoc provided for the function to understand what it does. - -**`ArgumentTokenizer.java`:** - -``` java -/** - * Tokenizes an arguments string and returns an {@code ArgumentMultimap} - * object that maps prefixes to their respective argument values. Only the - * given prefixes will be recognized in the arguments string. - * - * @param argsString Arguments string of the form: - * {@code preamble value value ...} - * @param prefixes Prefixes to tokenize the arguments string with - * @return ArgumentMultimap object that maps prefixes to their - * arguments - */ -``` - -We can tell `ArgumentTokenizer#tokenize()` to look out for our new prefix `r/` and it will return us an instance of `ArgumentMultimap`. Now let’s find out what we need to do in order to obtain the Index and String that we need. Let’s look through `ArgumentMultimap` : - -**`ArgumentMultimap.java`:** - -``` java -/** - * Returns the last value of {@code prefix}. - */ -public Optional getValue(Prefix prefix) { - List values = getAllValues(prefix); - return values.isEmpty() ? Optional.empty() : - Optional.of(values.get(values.size() - 1)); -} -``` - -This appears to be what we need to get a String of the remark. But what about the Index? Let's take a quick peek at existing `Command` that uses an index to see how it is done. - -**`DeleteCommandParser.java`:** - -``` java -Index index = ParserUtil.parseIndex(args); -return new DeleteCommand(index); -``` - -There appears to be another utility class that obtains an `Index` from the input provided by the user. - -Now that we have the know-how to extract the data that we need from the user’s input, we can parse the user command and create a new instance of `RemarkCommand`, as given below. - -**`RemarkCommandParser.java`:** - -``` java -public RemarkCommand parse(String args) throws ParseException { - requireNonNull(args); - ArgumentMultimap argMultimap = ArgumentTokenizer.tokenize(args, - PREFIX_REMARK); - - Index index; - try { - index = ParserUtil.parseIndex(argMultimap.getPreamble()); - } catch (IllegalValueException ive) { - throw new ParseException(String.format(MESSAGE_INVALID_COMMAND_FORMAT, - RemarkCommand.MESSAGE_USAGE), ive); - } - - String remark = argMultimap.getValue(PREFIX_REMARK).orElse(""); - - return new RemarkCommand(index, remark); -} -``` - -
- -:information_source: Don’t forget to update `AddressBookParser` to use our new `RemarkCommandParser`! - -
- -If you are stuck, check out the sample -[here](https://github.com/se-edu/addressbook-level3/commit/dc6d5139d08f6403da0ec624ea32bd79a2ae0cbf#diff-fc19ecee89c3732a62fbc8c840250508). - -## Add `Remark` to the model - -Now that we have all the information that we need, let’s lay the groundwork for propagating the remarks added into the in-memory storage of person data. We achieve that by working with the `Person` model. Each field in a Person is implemented as a separate class (e.g. a `Name` object represents the person’s name). That means we should add a `Remark` class so that we can use a `Remark` object to represent a remark given to a person. - -### Add a new `Remark` class - -Create a new `Remark` in `seedu.address.model.person`. Since a `Remark` is a field that is similar to `Address`, we can reuse a significant bit of code. - -A copy-paste and search-replace later, you should have something like [this](https://github.com/se-edu/addressbook-level3/commit/4516e099699baa9e2d51801bd26f016d812dedcc#diff-af2f075d24dfcd333876f0fbce321f25). Note how `Remark` has no constrains and thus does not require input -validation. - -### Make use of `Remark` - -Let’s change `RemarkCommand` and `RemarkCommandParser` to use the new `Remark` class instead of plain `String`. These should be relatively simple changes. - -## Add a placeholder element for remark to the UI - -Without getting too deep into `fxml`, let’s go on a 5 minute adventure to get some placeholder text to show up for each person. - -Simply add the following to [`seedu.address.ui.PersonCard`](https://github.com/se-edu/addressbook-level3/commit/850b78879582f38accb05dd20c245963c65ea599#diff-0c6b6abcfac8c205e075294f25e851fe). - -**`PersonCard.java`:** - -``` java -@FXML -private Label remark; -``` - - -`@FXML` is an annotation that marks a private or protected field and makes it accessible to FXML. It might sound like Greek to you right now, don’t worry — we will get back to it later. - -Then insert the following into [`main/resources/view/PersonListCard.fxml`](https://github.com/se-edu/addressbook-level3/commit/850b78879582f38accb05dd20c245963c65ea599#diff-12580431f55d7880578aa4c16f249e71). - -**`PersonListCard.fxml`:** - -``` xml -