Skip to content

Commit

Permalink
Update docs and code quality (#297)
Browse files Browse the repository at this point in the history
- Add class diagram for find command in dg
- Add more use cases
- minor update to PPP
- Clean up TODOs
  • Loading branch information
wz2k authored Apr 10, 2023
2 parents 9e1a9e8 + d879a50 commit 7c26766
Show file tree
Hide file tree
Showing 13 changed files with 78 additions and 28 deletions.
58 changes: 53 additions & 5 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,10 @@ The command execution flow is as given below
6. Based on the filtered elderly and volunteers a predicate to get the related pairs is created and ```updateFilteredPairList``` of ```Model``` is called.
7. ```CommandResult``` with the sizes of the 3 filtered lists is created and returned.

The class diagram below shows the relation of predicates to ```FindCommandParser``` and ```FindCommand```.

<img src="images/developerGuide/FindCommandClassDiagram.png" width="700" />

Design decisions:
- Name, address, email, phone, tags and medical qualification attributes allow substring searching.
- Easier to search with only partial information available.
Expand Down Expand Up @@ -666,7 +670,7 @@ Preconditions: Person is already in FL.

Use case ends.

**Use case: UC09- Find person and related pairs**
**Use case: UC10- Find person and related pairs**

**MSS**

Expand All @@ -681,7 +685,9 @@ Preconditions: Person is already in FL.
* 1a. FL detects missing arguments or an error in the entered command.
* 1a1. FL feedbacks that entered command is incorrect.

**Use case: UC10- View all persons and pairs**
Use case ends.

**Use case: UC11- View all persons and pairs**

**MSS**

Expand All @@ -696,7 +702,43 @@ Preconditions: Person is already in FL.
* 1a. FL detects missing arguments or an error in the entered command.
* 1a1. FL feedbacks that entered command is incorrect.

**Use case: UC11- View statistics**
Use case ends.

**Use case: UC12- View paired persons**

**MSS**

1. User enters the command to list all paired persons.
2. FL shows all the paired elderly, paired volunteers and all pairs.
3. User sees all paired persons and all pairs in FL.

Use case ends.

**Extensions**

* 1a. FL detects missing arguments or an error in the entered command.
* 1a1. FL feedbacks that entered command is incorrect.

Use case ends.

**Use case: UC13- View unpaired persons**

**MSS**

1. User enters the command to list all unpaired persons.
2. FL shows all the unpaired elderly, unpaired volunteers and all pairs.
3. User sees all unpaired persons and all pairs in FL.

Use case ends.

**Extensions**

* 1a. FL detects missing arguments or an error in the entered command.
* 1a1. FL feedbacks that entered command is incorrect.

Use case ends.

**Use case: UC14- View statistics**

**MSS**

Expand All @@ -711,7 +753,9 @@ Preconditions: Person is already in FL.
* 1a. FL detects an error in the entered command.
* 1a1. FL feedbacks that entered command is incorrect.

**Use case: UC12- Look up Help Page**
Use case ends.

**Use case: UC15- Look up Help Page**

**MSS**

Expand All @@ -726,7 +770,9 @@ Preconditions: Person is already in FL.
* 1a. FL detects an error in the entered command.
* 1a1. FL feedbacks that entered command is incorrect.

**Use case: UC13- Exit the app**
Use case ends.

**Use case: UC16- Exit the app**

**MSS**

Expand All @@ -741,6 +787,8 @@ Preconditions: Person is already in FL.
* 1a. FL detects an error in the entered command.
* 1a1. FL feedbacks that entered command is incorrect.

Use case ends.

### Non-Functional Requirements

1. FriendlyLink should work on Microsoft Windows, macOS, and Linux that has `Java 11` is installed.
Expand Down
2 changes: 0 additions & 2 deletions docs/Logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,3 @@ title: Logging guide
* The `LogsCenter` class is used to manage the logging levels and logging destinations.
* The `Logger` for a class can be obtained using `LogsCenter.getLogger(Class)` which will log messages according to the specified logging level.
* Log messages are output through the console and to a `.log` file.
* The output logging level can be controlled using the `logLevel` setting in the configuration file (See the [Configuration guide](Configuration.md) section).
* **When choosing a level for a log message**, follow the conventions given in [_[se-edu/guides] Java: Logging conventions_](https://se-education.org/guides/conventions/java/logging.html).
22 changes: 22 additions & 0 deletions docs/diagrams/developerGuide/FindCommandClassDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
@startuml
!include ../style.puml
skinparam arrowThickness 1.1
skinparam arrowColor LOGIC_COLOR_T4
skinparam classBackgroundColor LOGIC_COLOR

package Find {
Class FindCommandParser
Class "<<interface>> \n Predicate"
Class XYZPredicate
Class FindCommand
}

XYZPredicate .up|> "<<interface>> \n Predicate"
FindCommand .> XYZPredicate : Filter with >
FindCommandParser .down> XYZPredicate : Creates >
FindCommandParser .down> FindCommand : Creates >
"<<interface>> \n Predicate" -[hidden]down- FindCommand

note right of XYZPredicate: XYZPredicate = \nAddressContainsKeywordPredicate, \nRiskLevelIsEqualPredicate, etc

@enduml
File renamed without changes.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion docs/team/wz2k.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Given below are my contributions to the project.

* **Project management**:
* Kept track of deadlines.
* Managed releases `v1.4` and `v1.4.demo` on GitHub.

* **Enhancements to existing features**:
* Refactor most of AB3's person related stuff into FriendlyLink's elderly and volunteer version. (Pull requests [\#81](https://github.com/AY2223S2-CS2103T-W12-1/tp/pull/81))
Expand All @@ -35,7 +36,8 @@ Given below are my contributions to the project.
* Added documentation for the features `list` and `find`.
* Changed documentation of `edit` feature to `edit_elderly` and `edit_volunteer` features.
* Developer Guide:
* Added implementation details of the `find` feature.
* Added implementation details of the `find` feature with 2 types of UML diagrams.
* Added instructions for manual testing in appendix.

* **Community**:
* PRs reviewed (with non-trivial review comments): [\#89](https://github.com/AY2223S2-CS2103T-W12-1/tp/pull/89), [\#126](https://github.com/AY2223S2-CS2103T-W12-1/tp/pull/126)
Expand Down
3 changes: 0 additions & 3 deletions src/test/java/seedu/address/commons/util/JsonUtilTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,4 @@ public void deserializeObjectFromJsonFile_noExceptionThrown() throws IOException
assertEquals(serializableTestClass.getMapOfIntegerToString(), SerializableTestClass.getHashMapTestValues());
}

//TODO: @Test jsonUtil_readJsonStringToObjectInstance_correctObject()

//TODO: @Test jsonUtil_writeThenReadObjectToJson_correctObject()
}
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,6 @@ public void execute_fourFieldsSpecified_success() {
assertCommandSuccess(command, model, expectedMessage, expectedModel);
}

// TODO: all volunteer field specified after adding medical qualification attribute

@Test
public void execute_allElderlyFieldsSpecified_success() {
String expectedMessage = String.format(MESSAGE_LISTED_OVERVIEW, 1, 0, 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@
public class AddPairCommandParserTest {
private final AddPairCommandParser parser = new AddPairCommandParser();

@Test
public void parse_allFieldsPresent_success() {
// TODO: test with the same format as AddCommandParserTest::parse_allFieldsPresent_success()
}

@Test
public void parse_compulsoryFieldMissing_failure() {
String expectedMessage = String.format(MESSAGE_INVALID_COMMAND_FORMAT, AddPairCommand.MESSAGE_USAGE);
Expand All @@ -36,8 +31,4 @@ public void parse_compulsoryFieldMissing_failure() {
expectedMessage);
}

@Test
public void parse_invalidValue_failure() {
// TODO: Check for invalid elderly or volunteer
}
}
2 changes: 0 additions & 2 deletions src/test/java/seedu/address/model/ModelManagerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,6 @@ public void equals() {
.withUserPrefs(userPrefs)
.build());

// TODO: different filteredPairList -> returns false

// resets modelManager to initial state for upcoming tests
modelManager.updateAllFilteredLists((Predicate<Elderly>) PREDICATE_SHOW_ALL,
(Predicate<Volunteer>) PREDICATE_SHOW_ALL, (Predicate<Pair>) PREDICATE_SHOW_ALL);
Expand Down
1 change: 0 additions & 1 deletion src/test/java/seedu/address/model/pair/PairTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ public void isSamePair() {
.withEmail(VALID_EMAIL_BOB).withAddress(VALID_ADDRESS_BOB).withTags(VALID_TAG_SINGLE).build();
Pair editedPair1 = new PairBuilder(PAIR1).withElderly(editedAlice).build();
assertTrue(PAIR1.isSamePair(editedPair1));
// TODO: check that a different name returns true if nric is the same.

// different nric, all other attributes same -> returns false
editedAlice = new ElderlyBuilder(ALICE).withNric(VALID_NRIC_BOB).build();
Expand Down
2 changes: 0 additions & 2 deletions src/test/java/seedu/address/storage/StorageManagerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ public void prefsReadSave() throws Exception {
* More extensive testing of UserPref saving/reading is done in the storage classes test files.
*/

// TODO: pairReadSave(), follow implementations below

@Test
public void elderlyReadSave() throws Exception {
FriendlyLink original = getTypicalFriendlyLink();
Expand Down
1 change: 0 additions & 1 deletion src/test/java/seedu/address/testutil/TypicalElderly.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ public class TypicalElderly {
.withNric(VALID_NRIC_BOB).withBirthDate(VALID_BIRTH_DATE_BOB).withRegion(VALID_REGION_BOB)
.withRiskLevel(VALID_RISK_LEVEL_BOB).build();

// TODO: Replace magic strings
public static final Elderly CHARLIE = new ElderlyBuilder().withName("Charlie Kurz")
.withPhone("95352563").withEmail("[email protected]").withAddress("wall street")
.withBirthDate("1950-01-01").withNric(VALID_NRIC_CHARLIE).withRegion("NORTHEAST").build();
Expand Down

0 comments on commit 7c26766

Please sign in to comment.