Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Asset fields and change method of editing #128

Merged
merged 32 commits into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
cc08776
Add id and location to assets
yisiox Mar 24, 2024
0dfff5e
Asset.java: Make factory handle trim
yisiox Mar 24, 2024
301229d
Change edita command to asset
yisiox Mar 24, 2024
301fd68
CommandType.java: Update edita to asset
yisiox Mar 24, 2024
d848954
Fix test checkstyle
yisiox Mar 24, 2024
c5211f3
Add test and bugfix for asset
yisiox Mar 24, 2024
a2d05d8
Fix code style
yisiox Mar 24, 2024
4527ecc
Add tests for asset methods
yisiox Mar 24, 2024
a29de2e
Improve test coverage for command type enum
yisiox Mar 24, 2024
97ec174
Improve test coverage for assets
yisiox Mar 24, 2024
380b54b
Remove location field from asset
yisiox Mar 25, 2024
d0d98c8
Merge branch 'master' into 124-update-asset
aureliony Mar 26, 2024
71451e0
Merge updates from master
yisiox Apr 3, 2024
50e509c
Change asset to be identified by name
yisiox Apr 3, 2024
19e2836
Update regex for fields
yisiox Apr 3, 2024
7d07cf7
Merge branch '124-update-asset' of github.com:AY2324S2-CS2103T-W12-3/…
yisiox Apr 3, 2024
ed195a5
AssetCommand.java: Fix assertion
yisiox Apr 3, 2024
8a6e5e3
Add test for backslash in fields
yisiox Apr 3, 2024
9408eeb
Add missing space
aureliony Apr 3, 2024
c533007
Replace all instances of AssetBook-3 with AssetBook
aureliony Apr 3, 2024
84cd266
Replace AB3 with AB in DG
aureliony Apr 3, 2024
874028a
Replace / with \ in UG
aureliony Apr 3, 2024
3eca109
AssetTest.java: Remove unneeded tests
yisiox Apr 3, 2024
424a315
Merge branch '124-update-asset' of github.com:AY2324S2-CS2103T-W12-3/…
yisiox Apr 3, 2024
17db0b0
Update prefixes in asset command
yisiox Apr 4, 2024
7654d58
Fix typos for AB3
aureliony Apr 4, 2024
ab30a6b
AssetTest.java: Fix unused import
yisiox Apr 4, 2024
3c19b2c
Merge branch '124-update-asset' of github.com:AY2324S2-CS2103T-W12-3/…
yisiox Apr 4, 2024
25344bf
Update prefix of asset command
yisiox Apr 4, 2024
dce3762
Merge branch 'master' into 124-update-asset
bryanyee33 Apr 4, 2024
2b3024f
Fix minor issues
bryanyee33 Apr 4, 2024
0b101ce
Fix inconsistency
bryanyee33 Apr 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

![Ui](docs/images/Ui.png)

## AssetBook-3
## AssetBook

AssetBook-3 is a specialized application built upon [AddressBook-3](https://github.com/se-edu/addressbook-level3) for logistics and inventory managers to do contact and asset management.
AssetBook is a specialized application built upon [AddressBook-3](https://github.com/se-edu/addressbook-level3) for logistics and inventory managers to do contact and asset management.
It is meant for those who wish to easily retrieve contact details based on contact or asset details.

## Getting Started
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ dependencies {
}

shadowJar {
archiveFileName = 'assetbook-3.jar'
archiveFileName = 'assetbook.jar'
}

run {
Expand Down
40 changes: 20 additions & 20 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
layout: default.md
title: "Developer Guide"
title: "AssetBook Developer Guide"
pageNav: 3
---

# AB-3 Developer Guide
# AssetBook Developer Guide

<!-- * Table of Contents -->
<page-nav-print />
Expand Down Expand Up @@ -464,19 +464,19 @@ Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unli

### Use cases

(For all use cases below, the **System** is `AssetBook-3 (AB3)` and the **Actor** is the `user`, unless specified otherwise)
(For all use cases below, the **System** is `AssetBook (AB)` and the **Actor** is the `user`, unless specified otherwise)

**Use case: UC1 - Add a contact**
**MSS**
1. User requests to add a contact.
2. User specifies details of the contact.
3. AB3 adds the contact.<br>
3. AB adds the contact.<br>
Use case ends.

**Extensions**

<div class="step">2a. AB3 detects user input is invalid.</div>
<div class="sub-step">2a1. AB3 displays an error message.</div>
<div class="step">2a. AB detects user input is invalid.</div>
<div class="sub-step">2a1. AB displays an error message.</div>
<div class="sub-step">2a2. User enters new input.</div>
<div class="sub-step">Steps 2a1-2a2 are repeated until user input is valid.</div>
<div class="sub-step">Use case resumes from step 3.</div>
Expand All @@ -486,7 +486,7 @@ Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unli
**Use case: UC2 - List contacts**
**MSS**
1. User requests to list contacts.
2. AB3 displays all contacts.<br>
2. AB displays all contacts.<br>
Use case ends.

--- {.dotted}
Expand All @@ -495,13 +495,13 @@ Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unli
**MSS**
1. User requests to search contacts.
2. User specifies details to search by.
3. AB3 displays all matching contacts.<br>
3. AB displays all matching contacts.<br>
Use case ends.

**Extensions**

<div class="step">2a. AB3 detects user input is invalid.</div>
<div class="sub-step">2a1. AB3 displays an error message.</div>
<div class="step">2a. AB detects user input is invalid.</div>
<div class="sub-step">2a1. AB displays an error message.</div>
<div class="sub-step">2a2. User enters new input.</div>
<div class="sub-step">Steps 2a1-2a2 are repeated until user input is valid.</div>
<div class="sub-step">Use case resumes from step 3.</div>
Expand All @@ -513,15 +513,15 @@ Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unli
1. User !!lists contacts(UC2)!!.
2. User requests to edit a contact.
3. User specifies the index of the contact and details to edit.
4. AB3 updates the contact.<br>
4. AB updates the contact.<br>
Use case ends.

**Extensions**

<div class="step">1a. AB3 displays no contacts.</div>
<div class="step">1a. AB displays no contacts.</div>
<div class="sub-step">Use case ends.</div>
<div class="step">3a. AB3 detects user input is invalid.</div>
<div class="sub-step">3a1. AB3 displays an error message.</div>
<div class="step">3a. AB detects user input is invalid.</div>
<div class="sub-step">3a1. AB displays an error message.</div>
<div class="sub-step">3a2. User enters new input.</div>
<div class="sub-step">Steps 3a1-3a2 are repeated until user input is valid.</div>
<div class="sub-step">Use case resumes from step 4.</div>
Expand All @@ -533,13 +533,13 @@ Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unli
1. User !!lists contacts(UC2)!!.
2. User requests to delete a contact.
3. User specifies the index of the contact to delete.
4. AB3 deletes the contact.<br>
4. AB deletes the contact.<br>
Use case ends.

**Extensions**

<div class="step">3a. AB3 detects user input is invalid.</div>
<div class="sub-step">3a1. AB3 displays an error message.</div>
<div class="step">3a. AB detects user input is invalid.</div>
<div class="sub-step">3a1. AB displays an error message.</div>
<div class="sub-step">3a2. User enters new input.</div>
<div class="sub-step">Steps 3a1-3a2 are repeated until user input is valid.</div>
<div class="sub-step">Use case resumes from step 4.</div>
Expand All @@ -550,13 +550,13 @@ Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unli
**MSS**
1. User adds a new person to the json file.
2. User runs the application.
3. AB3 reads the json file and shows the updated contact list.<br>
3. AB reads the json file and shows the updated contact list.<br>
Use case ends.

**Extensions**

<div class="step">2a. AB3 detects that the json file is invalid.</div>
<div class="sub-step">2a1. AB3 displays a warning and loads an empty address book.</div>
<div class="step">2a. AB detects that the json file is invalid.</div>
<div class="sub-step">2a1. AB displays a warning and loads an empty address book.</div>
<div class="sub-step">Use case ends.</div>

---
Expand Down
68 changes: 34 additions & 34 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
layout: default.md
title: "User Guide"
title: "AssetBook User Guide"
pageNav: 3
---

# AssetBook-3 User Guide
# AssetBook User Guide

---

Expand All @@ -18,11 +18,11 @@ Welcome **logistics managers**! If you are someone who

3. Is feeling swamped by the tedium of contact management on traditional office software...

*Rejoice because AssetBook-3 is here!*<br><br>
AssetBook-3 helps to streamline the task of **tracking contacts and which logistical assets they are in charge of**,
*Rejoice because AssetBook is here!*<br><br>
AssetBook helps to streamline the task of **tracking contacts and which logistical assets they are in charge of**,
making your management tasks smoother than ever.

AssetBook-3 is designed to:
AssetBook is designed to:

+ **Digitally Organize Your Contacts**<br> Say goodbye to scattered contacts; now, have them all organized and accessible in one place.

Expand All @@ -34,13 +34,13 @@ AssetBook-3 is designed to:

## Using this Guide

This user guide contains all information needed to use AssetBook-3.
This user guide contains all information needed to use AssetBook.
A [glossary](#glossary) is provided in case you encounter any unfamiliar terms.

#### New Users

If this your first time using AssetBook-3, head over to the [quick start](#quick-start) to learn how to set up the application.
After which, you can have a look at the [features](#features) of AssetBook-3, or simply follow this guide in order.
If this your first time using AssetBook, head over to the [quick start](#quick-start) to learn how to set up the application.
After which, you can have a look at the [features](#features) of AssetBook, or simply follow this guide in order.

#### Experienced Users

Expand All @@ -59,7 +59,7 @@ or skip to the [command summary](#command-summary).

<!-- * Table of Contents -->
## Table of Contents
+ [Introduction](#assetbook-3-user-guide)
+ [Introduction](#assetbook-user-guide)
+ [Using this Guide](#using-this-guide)
+ [Table of Contents](#table-of-contents)
+ [Quick Start](#quick-start)
Expand Down Expand Up @@ -89,10 +89,10 @@ or skip to the [command summary](#command-summary).

1. Ensure you have [Java 11](https://www.oracle.com/sg/java/technologies/javase/jdk11-archive-downloads.html) installed on your Computer.

2. Download the latest `assetbook-3.jar` from [here](https://github.com/AY2324S2-CS2103T-W12-3/tp/releases).
2. Download the latest `assetbook.jar` from [here](https://github.com/AY2324S2-CS2103T-W12-3/tp/releases).

3. Move the file into the folder where you want AssetBook-3 to store the contact information. New users may simply
create a folder on their desktop, then drag and drop `assetbook-3.jar` inside.
3. Move the file into the folder where you want AssetBook to store the contact information. New users may simply
create a folder on their desktop, then drag and drop `assetbook.jar` inside.

4. Double-click on the `jar` file and a GUI as shown in the following section should appear.
Note that the app contains some sample data when launched for the first time.
Expand All @@ -118,7 +118,7 @@ Here are the components of the GUI.

### Tutorials

This section provides a walkthrough of common actions performed in AssetBook-3.
This section provides a walkthrough of common actions performed in AssetBook.
All actions are performed through typing a command into the **command input box**.
For detailed documentation of all available commands, refer to the [features](#features) section.

Expand All @@ -141,13 +141,13 @@ For detailed documentation of all available commands, refer to the [features](#f
**Notes about the command format**

* Items in square brackets are optional.<br>
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\John Doe t\friend` or as `n\John Doe`.

* Items followed by `...` indicates that it can be entered multiple times (or zero times).<br>
e.g. `[t/TAG]...` can be used as `t/friend`, `t/friend t/colleague` etc.
e.g. `[t\TAG]...` can be used as `t\friend`, `t\friend t\colleague` etc.

* Parameters can be in any order.<br>
e.g. if the command specifies `n/NAME p/PHONE`, `p/PHONE n/NAME` is also acceptable.
e.g. if the command specifies `n\NAME p\PHONE`, `p\PHONE n\NAME` is also acceptable.

* Extraneous parameters for commands that do not take in parameters (such as `exit`) will be ignored.<br>
e.g. if the command specifies `exit 123`, it will be interpreted as `exit`.
Expand All @@ -166,14 +166,14 @@ For detailed documentation of all available commands, refer to the [features](#f

Adds a new contact to the system, with 0 or more assets associated with the contact.

Format: `add n/NAME p/PHONE e/EMAIL o/OFFICE [t/TAG]... [a/ASSET]...`
Format: `add n\NAME p\PHONE e\EMAIL o\OFFICE [t\TAG]... [a\ASSET]...`

<box type="tip" seamless>
A person can have any number of tags and assets (including 0)
</box>

#### Examples
* Add a new contact associated with the asset `L293D`: `add n/John Doe e/johndoe@example.com o/574 Ang Mo Kio Ave 10 p/12345678 a/L293D`
* Add a new contact associated with the asset `L293D`: `add n\John Doe e\johndoe@example.com o\574 Ang Mo Kio Ave 10 p\12345678 a\L293D`

#### Options
`NAME`
Expand Down Expand Up @@ -202,7 +202,7 @@ A person can have any number of tags and assets (including 0)
* Contact can be created first without assets, then assets can be added later using the Edit command.
* Case sensitive, i.e. NUS ≠ nus.
* Assets must have unique names. If the asset already exists in the database, the existing asset will be linked instead of a new asset.
* Multiple assets can be specified. For example, a valid option is `a/asset1 a/asset2 a/asset3`.
* Multiple assets can be specified. For example, a valid option is `a\asset1 a\asset2 a\asset3`.

--------------------------------------------------------------------------------------------------------------------

Expand All @@ -223,26 +223,26 @@ Format: `delete INDEX`

Edit existing contacts without recreating them.

Format: `edit INDEX [n/NAME] [p/PHONE] [e/EMAIL] [o/OFFICE] [t/TAG]... [a/ASSET]...`
Format: `edit INDEX [n\NAME] [p\PHONE] [e\EMAIL] [o\OFFICE] [t\TAG]... [a\ASSET]...`

Example: `edit 1 e/newemail@example.com` edits the contact with id `1`, changing its email to `newemail@example.com`.
Example: `edit 1 e\newemail@example.com` edits the contact with id `1`, changing its email to `newemail@example.com`.

* Edits the contact with the specified `INDEX`. `INDEX` refers to the unique contact index shown in the GUI.
* At least one of the optional fields must be provided.
* Existing values will be updated to the input values.
* When editing assets, the existing assets of the person will be removed i.e adding of assets is not cumulative.
* You can remove all the person’s tags by typing `t/` without specifying any tags after it.
* You can remove all the person’s assets by typing `a/` without specifying any assets after it.
* You can remove all the person’s tags by typing `t\` without specifying any tags after it.
* You can remove all the person’s assets by typing `a\` without specifying any assets after it.

--------------------------------------------------------------------------------------------------------------------

### Editing an Asset: `asset`

Edit existing assets without recreating them.

Format: `asset old/OLD_ASSET_NAME new/NEW_ASSET_NAME`
Format: `asset o/OLD_ASSET_NAME n/NEW_ASSET_NAME`

Example: `asset old/hammer new/screwdriver` edits the asset `hammer`, changing its name to `screwdriver`.
Example: `asset o/hammer n/screwdriver` edits the asset `hammer`, changing its name to `screwdriver`.

* The asset will be renamed for all contacts linked to it.

Expand Down Expand Up @@ -295,28 +295,28 @@ Format: `exit`

### Saving the data file

AssetBook-3's data is saved automatically after any command that changes the data. There is no need to save manually.
AssetBook's data is saved automatically after any command that changes the data. There is no need to save manually.

--------------------------------------------------------------------------------------------------------------------

### Editing the data file

AssetBook-3's data are saved automatically as a JSON file `[JAR file location]/data/assetbook.json`.<br>
Advanced users are welcome to update data directly by editing that data file.
AssetBook's data are saved automatically as a JSON file `[JAR file location]/data/assetbook.json`.<br>
Advanced users are welcome to update the data directly by editing that data file.

<box type="warning" seamless>

**Caution:**
If your changes to the data file makes its format invalid, AssetBook-3 will discard all data and start with an empty data file at the next run. Hence, it is recommended to take a backup of the file before editing it.<br>
Furthermore, certain edits can cause the AssetBook-3 to behave in unexpected ways (e.g., if a value entered is outside the acceptable range). Therefore, edit the data file only if you are confident that you can update it correctly.
If your changes to the data file makes its format invalid, AssetBook will discard all data and start with an empty data file at the next run. Hence, it is recommended to take a backup of the file before editing it.<br>
Furthermore, certain edits can cause the AssetBook to behave in unexpected ways (e.g., if a value entered is outside the acceptable range). Therefore, edit the data file only if you are confident that you can update it correctly.
</box>

---{.double}

## FAQ

**Q**: How do I transfer my data to another Computer?<br>
**A**: Install the app in the other computer and replace the JSON data file it creates with the JSON file from your previous AssetBook-3 home folder.
**A**: Install the app in the other computer and replace the JSON data file it creates with the JSON file from your previous AssetBook home folder.

--------------------------------------------------------------------------------------------------------------------

Expand All @@ -330,10 +330,10 @@ Furthermore, certain edits can cause the AssetBook-3 to behave in unexpected way

Action | Format | Example
-----------------|------------------------------------------------------------------------------|---
**Add** | `add n/NAME p/PHONE e/EMAIL o/OFFICE [t/TAG]... [a/ASSET]...` | `add n/John Doe e/johndoe@example.com p/+12345678 a/L293D`
**Add** | `add n\NAME p\PHONE e\EMAIL o\OFFICE [t\TAG]... [a\ASSET]...` | `add n\John Doe e\johndoe@example.com p\+12345678 a\L293D`
**Delete** | `delete INDEX` | `delete 1`
**Edit contact** | `edit INDEX [n/NAME] [p/PHONE] [e/EMAIL] [o/OFFICE] [t/TAG]... [a/ASSET]...` | `edit 1 e/newemail@example.com`
**Edit asset** | `asset old/OLD_ASSET_NAME new/NEW_ASSET_NAME` | `asset old/hammer new/screwdriver`
**Edit contact** | `edit INDEX [n\NAME] [p\PHONE] [e\EMAIL] [o\OFFICE] [t\TAG]... [a\ASSET]...` | `edit 1 e\newemail@example.com`
**Edit asset** | `asset o\OLD_ASSET_NAME n\NEW_ASSET_NAME` | `asset o\hammer n\screwdriver`
**Find** | `find QUERY` | `find John`
**Undo** | `undo` | `undo`
**Exit** | `exit` | `exit`
Expand Down
2 changes: 1 addition & 1 deletion docs/_markbind/layouts/default.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<header sticky>
<navbar type="dark">
<a slot="brand" href="{{baseUrl}}/index.html" title="Home" class="navbar-brand">AssetBook-3</a>
<a slot="brand" href="{{baseUrl}}/index.html" title="Home" class="navbar-brand">AssetBook</a>
<li><a href="{{baseUrl}}/index.html" class="nav-link">Home</a></li>
<li><a href="{{baseUrl}}/UserGuide.html" class="nav-link">User Guide</a></li>
<li><a href="{{baseUrl}}/DeveloperGuide.html" class="nav-link">Developer Guide</a></li>
Expand Down
8 changes: 4 additions & 4 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
title: ""
---

# AssetBook-3
# AssetBook

[![CI Status](https://github.com/AY2324S2-CS2103T-W12-3/tp/workflows/Java%20CI/badge.svg)](https://github.com/AY2324S2-CS2103T-W12-3/tp/actions)
[![codecov](https://codecov.io/gh/AY2324S2-CS2103T-W12-3/tp/branch/master/graph/badge.svg)](https://codecov.io/gh/AY2324S2-CS2103T-W12-3/tp)

![Ui](images/Ui.png)

**AssetBook-3 is a desktop application for logistics managers to keep track point-of-contacts' (POCs) contact information, along with their relevant assets.** While it has a GUI, most of the user interactions happen using a CLI (Command Line Interface).
**AssetBook is a desktop application for logistics managers to keep track point-of-contacts' (POCs) contact information, along with their relevant assets.** While it has a GUI, most of the user interactions happen using a CLI (Command Line Interface).

* If you are interested in using AssetBook-3, head over to the [_Quick Start_ section of the **User Guide**](UserGuide.html#quick-start).
* If you are interested about developing AssetBook-3, the [**Developer Guide**](DeveloperGuide.html) is a good place to start.
* If you are interested in using AssetBook, head over to the [_Quick Start_ section of the **User Guide**](UserGuide.html#quick-start).
* If you are interested about developing AssetBook, the [**Developer Guide**](DeveloperGuide.html) is a good place to start.


**Acknowledgements**
Expand Down
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "docs",
"version": "1.0.0",
"description": "AB-3 docs",
"description": "AssetBook docs",
"scripts": {
"init": "markbind init",
"build": "markbind build",
Expand Down
2 changes: 1 addition & 1 deletion docs/site.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"baseUrl": "",
"titlePrefix": "",
"titleSuffix": "AssetBook-3",
"titleSuffix": "AssetBook",
"faviconPath": "images/SeEduLogo.png",
"style": {
"codeTheme": "light"
Expand Down
2 changes: 1 addition & 1 deletion docs/team/aureliony.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

### Project: AssetBook3

AssetBook-3 is a desktop application for logistics managers to keep track point-of-contacts' (POCs) contact information, along with their relevant assets. It is meant for those who have too many POCs and assets, and wish to easily retrieve contact details based on name, tag, or asset ID.
AssetBook is a desktop application for logistics managers to keep track point-of-contacts' (POCs) contact information, along with their relevant assets. It is meant for those who have too many POCs and assets, and wish to easily retrieve contact details based on name, tag, or asset ID.

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.

Expand Down
Loading