From e4a0e19c66e99d1deec1c64efbbe25b80db3bbe3 Mon Sep 17 00:00:00 2001
From: Plishh <101051455+Plishh@users.noreply.github.com>
Date: Tue, 12 Nov 2024 01:14:20 +0800
Subject: [PATCH 1/4] Fix duplicate Person
---
src/main/java/seedu/address/model/person/Person.java | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/main/java/seedu/address/model/person/Person.java b/src/main/java/seedu/address/model/person/Person.java
index 57f5e754a32..44d8789e835 100644
--- a/src/main/java/seedu/address/model/person/Person.java
+++ b/src/main/java/seedu/address/model/person/Person.java
@@ -104,8 +104,7 @@ public boolean isSamePerson(Person otherPerson) {
}
return otherPerson != null
- && otherPerson.getName().equals(getName()) && otherPerson.getPhone().equals(getPhone())
- && otherPerson.isTutee() == this.isTutee();
+ && otherPerson.getName().equals(getName()) && otherPerson.getPhone().equals(getPhone());
}
@Override
From 2ec5ac985cb83fad49746f74c4a894a0ea332a2d Mon Sep 17 00:00:00 2001
From: Plishh <101051455+Plishh@users.noreply.github.com>
Date: Tue, 12 Nov 2024 02:42:43 +0800
Subject: [PATCH 2/4] Fix bugs
---
docs/DeveloperGuide.md | 54 +++++++++----------
docs/diagrams/LogicClassDiagram.puml | 3 ++
.../seedu/address/model/person/Person.java | 7 ++-
3 files changed, 35 insertions(+), 29 deletions(-)
diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md
index fbab5c58553..1495312c2fd 100644
--- a/docs/DeveloperGuide.md
+++ b/docs/DeveloperGuide.md
@@ -1,7 +1,7 @@
---
layout: default.md
- title: "Developer Guide"
- pageNav: 3
+ title: "Developer Guide"
+ pageNav: 3
---
# VolunTier Developer Guide
@@ -110,6 +110,7 @@ How the `Logic` component works:
Note that although this is shown as a single step in the diagram above (for simplicity), in the code it can take several interactions (between the command object and the `Model`) to achieve.
1. The command also commits the address book to the model.
1. The result of the command execution is encapsulated as a `CommandResult` object which is returned back from `Logic`.
+1. The CommandHistory.add() method is called to add the command string entered to the command history.
Here are the other classes in `Logic` (omitted from the class diagram above) that are used for parsing a user command:
@@ -156,16 +157,16 @@ This section describes some noteworthy details on how certain features are imple
### CSV import feature
-The ImportCommand class in [`ImportCommand.java`](https://github.com/AY2425S1-CS2103T-F08-1a/tp/blob/master/src/main/java/seedu/address/logic/commands/ImportCommand.java)
-allows users to import data from a CSV file and add multiple persons at once to the address book.
+The ImportCommand class in [`ImportCommand.java`](https://github.com/AY2425S1-CS2103T-F08-1a/tp/blob/master/src/main/java/seedu/address/logic/commands/ImportCommand.java)
+allows users to import data from a CSV file and add multiple persons at once to the address book.
-The import process reads the CSV file, validates the data, and converts each row into a JsonAdaptedPerson object,
-which is then added to the model if it meets specified constraints. If any rows fail validation or contain duplicates,
+The import process reads the CSV file, validates the data, and converts each row into a JsonAdaptedPerson object,
+which is then added to the model if it meets specified constraints. If any rows fail validation or contain duplicates,
they are skipped, and detailed feedback is provided to the user.
-The `ImportCommand` makes use of the `CsvImport` helper class, which is responsible for parsing and validating CSV data.
+The `ImportCommand` makes use of the `CsvImport` helper class, which is responsible for parsing and validating CSV data.
Here's how the command works:
Step 1. File Path Input: The command accepts a file path as an argument, specifying the location of the CSV file to import.
@@ -187,7 +188,7 @@ The Import mechanism is facilitated by `CsvImport` which is responsible for pars
### View Tutee Chart feature
-The View Tutee Chart (VTC) feature in [`ViewTutorChartCommand`](https://github.com/AY2425S1-CS2103T-F08-1a/tp/blob/master/src/main/java/seedu/address/logic/commands/ViewTutorChartCommand.java)
+The View Tutee Chart (VTC) feature in [`ViewTutorChartCommand`](https://github.com/AY2425S1-CS2103T-F08-1a/tp/blob/master/src/main/java/seedu/address/logic/commands/ViewTutorChartCommand.java)
displays tutors in a bar chart, sorted by their tutoring hours in ascending order.
The ViewTutorChartCommand class retrieves all tutors from the Model, sorts them in ascending order by tutoring hours, and generates a message alongside a bar chart displaying this data in the UI.
@@ -284,13 +285,13 @@ The following activity diagram summarizes what happens when a user executes a ne
**Aspect: How undo & redo executes:**
* **Alternative 1 (current choice):** Saves the entire address book.
- * Pros: Easy to implement.
- * Cons: May have performance issues in terms of memory usage.
+ * Pros: Easy to implement.
+ * Cons: May have performance issues in terms of memory usage.
* **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.
+ * 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.
--------------------------------------------------------------------------------------------------------------------
@@ -310,7 +311,6 @@ The following activity diagram summarizes what happens when a user executes a ne
**Target user profile**:
-**Target user profile**:
* has a need to manage a significant number of volunteer tutoring records
* prefer desktop apps over other types
@@ -386,10 +386,9 @@ Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unli
1. User views list of persons (UC1)
2. User requests to delete a specific person in the list
-3. VolunTier prompts the user for confirmation
-4. VolunTier deletes the person
+3. VolunTier deletes the person
- Use case ends.
+ Use case ends.
**Extensions**
@@ -501,8 +500,8 @@ testers are expected to do more *exploratory* testing.
### Adding a person
1. Adding a tutor with no email
- 1a. Test case: “addTutor \n John Lim \p 81234578 \a ADDRESS, 123456”
- Expected: No tutor is added. Error is thrown, saying invalid command format.
+ 1a. Test case: “addTutor \n John Lim \p 81234578 \a ADDRESS, 123456”
+ Expected: No tutor is added. Error is thrown, saying invalid command format.
### Deleting a person
@@ -568,13 +567,14 @@ testers are expected to do more *exploratory* testing.
1. Adding a lesson with all fields filled
- 1a. Prerequisites: Clear the list with the command `clear`
- Add a tutor with the command `addTutor \n Alice \p 81234567 \e alice@gmail.com \a Block 123, Alice Street, 123456 \h 20 \s math`.
- Add a tutee with the command `addTutee \n Bob \p 98765432 \e bob@gmail.com \a Block 123, Bob Street, 223456 \h 20 \s math`.
-
- 1b. Test case: `addLesson 1 2 math`
- Expected: New lesson is added to the list. Details of the new lesson shown in the status message.
-
- 1c. Test case: `addLesson 1 2 math`
- Expected: No lesson is added. Error details shown in the status message for duplicate lesson.
+ 1a. Prerequisites: Clear the list with the command `clear`
+ Add a tutor with the command `addTutor \n Alice \p 81234567 \e alice@gmail.com \a Block 123, Alice Street, 123456 \h 20 \s math`.
+ Add a tutee with the command `addTutee \n Bob \p 98765432 \e bob@gmail.com \a Block 123, Bob Street, 223456 \h 20 \s math`.
+
+ 1b. Test case: `addLesson 1 2 math`
+ Expected: New lesson is added to the list. Details of the new lesson shown in the status message.
+
+ 1c. Test case: `addLesson 1 2 math`
+ Expected: No lesson is added. Error details shown in the status message for duplicate lesson.
+
diff --git a/docs/diagrams/LogicClassDiagram.puml b/docs/diagrams/LogicClassDiagram.puml
index 312082b16a2..c1b19e07dc4 100644
--- a/docs/diagrams/LogicClassDiagram.puml
+++ b/docs/diagrams/LogicClassDiagram.puml
@@ -16,6 +16,7 @@ Class "{abstract}\nCommand" as Command
Class "<>\nLogic" as Logic
Class LogicManager
+Class CommandHistory
}
package Model {
@@ -45,4 +46,6 @@ note right of XYZCommand: XYZCommand = AddCommand, \nFindCommand, etc
Logic ..> CommandResult
LogicManager .down.> CommandResult
Command .up.> CommandResult : <>
+
+LogicManager -left->"1" CommandHistory
@enduml
diff --git a/src/main/java/seedu/address/model/person/Person.java b/src/main/java/seedu/address/model/person/Person.java
index 44d8789e835..68d36dc5def 100644
--- a/src/main/java/seedu/address/model/person/Person.java
+++ b/src/main/java/seedu/address/model/person/Person.java
@@ -103,10 +103,13 @@ public boolean isSamePerson(Person otherPerson) {
return true;
}
- return otherPerson != null
- && otherPerson.getName().equals(getName()) && otherPerson.getPhone().equals(getPhone());
+ boolean res = otherPerson != null
+ && otherPerson.getName().equals(getName()) ;
+ return res;
}
+
+
@Override
public int hashCode() {
// use this method for custom fields hashing instead of implementing your own
From a72e8007739f5dcae339162e512c58eb76029967 Mon Sep 17 00:00:00 2001
From: Plishh <101051455+Plishh@users.noreply.github.com>
Date: Tue, 12 Nov 2024 02:51:22 +0800
Subject: [PATCH 3/4] Fix checkstyle
---
src/main/java/seedu/address/model/person/Person.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main/java/seedu/address/model/person/Person.java b/src/main/java/seedu/address/model/person/Person.java
index 68d36dc5def..846eb4065eb 100644
--- a/src/main/java/seedu/address/model/person/Person.java
+++ b/src/main/java/seedu/address/model/person/Person.java
@@ -104,7 +104,7 @@ public boolean isSamePerson(Person otherPerson) {
}
boolean res = otherPerson != null
- && otherPerson.getName().equals(getName()) ;
+ && otherPerson.getName().equals(getName());
return res;
}
From 6699ad1b4a38a1d60ffa6887ec605552534f1864 Mon Sep 17 00:00:00 2001
From: Plishh <101051455+Plishh@users.noreply.github.com>
Date: Tue, 12 Nov 2024 02:57:20 +0800
Subject: [PATCH 4/4] Fix test
---
src/main/java/seedu/address/model/person/Person.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main/java/seedu/address/model/person/Person.java b/src/main/java/seedu/address/model/person/Person.java
index 846eb4065eb..4efff7ce87a 100644
--- a/src/main/java/seedu/address/model/person/Person.java
+++ b/src/main/java/seedu/address/model/person/Person.java
@@ -104,7 +104,7 @@ public boolean isSamePerson(Person otherPerson) {
}
boolean res = otherPerson != null
- && otherPerson.getName().equals(getName());
+ && otherPerson.getName().equals(getName()) && otherPerson.getPhone().equals(getPhone());
return res;
}