Skip to content

Commit

Permalink
Merge pull request #158 from AY2324S2-CS2103T-W12-3/add-edita-dg
Browse files Browse the repository at this point in the history
Add edit asset details in DG
  • Loading branch information
yisiox authored Mar 29, 2024
2 parents 4523837 + 10952ec commit 15b86af
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,21 @@ The following sequence diagram shows how a `find David` command is executed.
<puml src="diagrams/FindSequenceDiagram.puml" alt="Interactions between components for the `find David` Command" />
<br><br>

### Edit Asset feature

The following sequence diagram shows how a `edita old/Aircon new/Hammer` command is executed.

<puml src="diagrams/EditAssetSequenceDiagram.puml" alt="Interactions between components for the `edita old/Aircon new/Hammer` Command" />
<br><br>

The edit asset mechanism is implemented by the following operations:

1. Search through the entire `persons` list.
2. Look through the `asset` list in each `person`.
3. If the `asset` name names the `asset` name in the `old/` prefix, then change it to the `asset` name specified in the `new/` prefix. If the `asset` name does not match, do nothing.

**Note:** If the `asset` name specified in the `old/` prefix does not exist within the application, the application will throw an error to inform the user that the command is invalid.

### Undo/Redo feature

The undo/redo mechanism is implemented within `AddressBook.java` by saving the entire `persons` list. It uses an undo and a redo stack to maintain the history. Additionally, it implements the following operations:
Expand Down

0 comments on commit 15b86af

Please sign in to comment.