Skip to content

Commit

Permalink
Merge pull request #385
Browse files Browse the repository at this point in the history
Update DG for Export Command
  • Loading branch information
currynia authored Nov 12, 2024
2 parents b2e666b + efd3e59 commit ea6916a
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
26 changes: 26 additions & 0 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@ Classes used by multiple components are in the `seedu.address.commons` package.

This section describes some noteworthy details on how certain features are implemented.

---

### Add contacts

**Overview**
Expand Down Expand Up @@ -220,6 +222,8 @@ Note: While the diagram shows the lifeline of objects even after their deletion,
2. KonTActs will create a contact of Tom with the given details before adding it to the contact list.
3. The contact is then displayed in the UI, along with a success message.

---

### Add Grade implementation

**Logic**:
Expand All @@ -236,6 +240,8 @@ This is illustrated in the activity diagram below:
* addGrade checks whether the assignment exists in the database, if the score is valid and if the person exists in the contacts.
* If the conditions are satisfied, the assignment is added to the `HashMap` in the person object which stores all the added assignments of that person.

---

### MarkCommand

<puml src="diagrams/MarkCommandActivityDiagram.puml" width="750" />
Expand All @@ -253,6 +259,25 @@ This is illustrated in the activity diagram below:

---

### Export Command implementation
**API** [`Export.java`](https://github.com/AY2425S1-CS2103T-T11-2/tp/blob/master/src/main/java/seedu/address/storage/Export.java)

The `ExportCommand` is used by KonTActs to allow users to export contact data as a CSV file that can be
easily shared or imported. The ExportCommand operates on the existing list of contacts and
exports them to the specified file location.

- The command validates the file path and handle any errors during the export process.
- Error message will be displayed if any errors are encountered.
- ExportCommand retrieves all contact data from KonTActs and formats the data it into a CSV file.
- After the export is completed (file is saved at desired location), a confirmation message will be displayed.

A visual representation is shown below of how a typical user might use the `ExportCommand`,


<puml src="diagrams/Export.puml" width="550"></puml>

---

### Command History implementation
**API** : [`CommandHistory.java`](https://github.com/AY2425S1-CS2103T-T11-2/tp/blob/master/src/main/java/seedu/address/storage/CommandHistory.java)

Expand Down Expand Up @@ -285,6 +310,7 @@ A visual representation is shown below of how a typical user might use the `Comm

{{ newPage }}


## **Documentation, logging, testing, configuration, dev-ops**

- [Documentation guide](Documentation.md)
Expand Down
11 changes: 11 additions & 0 deletions docs/diagrams/Export.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@startuml
start
:User executes Export Command;
if () then ([File Path is valid and user\n have write permission])
:Information of current contacts in \nKontacts exported as CSV file to\ndesired location.;
:Export Command returns a message \nindicating successful import.;
else ([else])
:Export Command returns an error message to the user.;
endif
stop
@enduml

0 comments on commit ea6916a

Please sign in to comment.