Skip to content

Commit

Permalink
Merge branch 'master' into implement-delete
Browse files Browse the repository at this point in the history
  • Loading branch information
samriddh2145 authored Oct 16, 2024
2 parents 155699b + c44cc04 commit 7ac000a
Show file tree
Hide file tree
Showing 20 changed files with 63 additions and 54 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

# Health Connect

Health Connect is an application designed to streamline client management for healthcare professionals. It allows users to efficiently track client details and appointments, simplifying the management process.
Health Connect is an application designed to streamline client management for Singapore based healthcare professionals.
It allows users to efficiently track client details and appointments, simplifying the management process.

## Features

Expand Down
3 changes: 2 additions & 1 deletion docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,10 @@ Home-based healthcare providers who
* Can type fast
* Prefers typing to mouse interactions
* Is reasonably comfortable using CLI apps
* Are based in Singapore


**Value proposition**: Our patient management system empowers home-based healthcare providers to efficiently retrieve and analyze patient information, enabling them to provide personalized care and see their schedule for the day.
**Value proposition**: Our patient management system empowers home-based healthcare providers to efficiently retrieve and prioritise patient information, enabling them to provide personalized care and see their schedule for the day.


### User stories
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/seedu/address/logic/Messages.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public static String format(Person person) {
.append(person.getEmail())
.append("; Address: ")
.append(person.getAddress())
.append("; Tags: ")
.append("; Tag: ")
.append(person.getTag());
return builder.toString();
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/seedu/address/model/person/Name.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public boolean equals(Object other) {
}

Name otherName = (Name) other;
return fullName.equals(otherName.fullName);
return fullName.equalsIgnoreCase(otherName.fullName);
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/seedu/address/model/person/Person.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public boolean isSamePerson(Person otherPerson) {
}

return otherPerson != null
&& otherPerson.getName().equals(getName());
&& (otherPerson.getName().equals(getName()) && otherPerson.getPhone().equals(getPhone()));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/seedu/address/model/person/Phone.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class Phone {

public static final String MESSAGE_CONSTRAINTS =
"Invalid Singapore phone number input. Enter a valid phone number that is more than 3 digits.";
public static final String VALIDATION_REGEX = "\\d{3,}";
public static final String VALIDATION_REGEX = "[3689]\\d{7}";
public final String value;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"phone": "94351253",
"email": "[email protected]",
"address": "123, Jurong West Ave 6, #08-111",
"tags": "High Risk"
"tag": "High Risk"
}, {
"name": "Alice Pauline",
"phone": "94351253",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ public void equals() {
public void toStringMethod() {
AddCommand addCommand = new AddCommand(ALICE);
String expected = AddCommand.class.getCanonicalName() + "{toAdd=" + ALICE + "}";
System.out.println(expected);
System.out.println(addCommand.toString());
assertEquals(expected, addCommand.toString());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ public class CommandTestUtil {

public static final String VALID_NAME_AMY = "Amy Bee";
public static final String VALID_NAME_BOB = "Bob-Choo";
public static final String VALID_PHONE_AMY = "11111111";
public static final String VALID_PHONE_BOB = "22222222";
public static final String VALID_PHONE_AMY = "99999999";
public static final String VALID_PHONE_BOB = "88888888";
public static final String VALID_EMAIL_AMY = "[email protected]";
public static final String VALID_EMAIL_BOB = "[email protected]";
public static final String VALID_ADDRESS_AMY = "Block 312, Amy Street 1";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public void execute_someFieldsSpecifiedUnfilteredList_success() {

PersonBuilder personInList = new PersonBuilder(lastPerson);
Person editedPerson = personInList.withName(VALID_NAME_BOB).withPhone(VALID_PHONE_BOB)
.withTags(VALID_TAG_HIGH_RISK).build();
.withTag(VALID_TAG_HIGH_RISK).build();

EditPersonDescriptor descriptor = new EditPersonDescriptorBuilder().withName(VALID_NAME_BOB)
.withPhone(VALID_PHONE_BOB).withTags(VALID_TAG_HIGH_RISK).build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public class AddCommandParserTest {

@Test
public void parse_allFieldsPresent_success() {
Person expectedPerson = new PersonBuilder(BOB).withTags(VALID_TAG_LOW_RISK).build();
Person expectedPerson = new PersonBuilder(BOB).withTag(VALID_TAG_LOW_RISK).build();

// whitespace only preamble
assertParseSuccess(parser, PREAMBLE_WHITESPACE + NAME_DESC_BOB + PHONE_DESC_BOB + EMAIL_DESC_BOB
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class ParserUtilTest {
private static final String INVALID_TAG = "#friend";

private static final String VALID_NAME = "Rachel Walker";
private static final String VALID_PHONE = "123456";
private static final String VALID_PHONE = "98765432";
private static final String VALID_ADDRESS = "123 Main Street #0505";
private static final String VALID_EMAIL = "[email protected]";
private static final String VALID_TAG_1 = "High Risk";
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/seedu/address/model/AddressBookTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public void resetData_withValidReadOnlyAddressBook_replacesData() {
@Test
public void resetData_withDuplicatePersons_throwsDuplicatePersonException() {
// Two persons with the same identity fields
Person editedAlice = new PersonBuilder(ALICE).withAddress(VALID_ADDRESS_BOB).withTags(VALID_TAG_HIGH_RISK)
Person editedAlice = new PersonBuilder(ALICE).withAddress(VALID_ADDRESS_BOB).withTag(VALID_TAG_HIGH_RISK)
.build();
List<Person> newPersons = Arrays.asList(ALICE, editedAlice);
AddressBookStub newData = new AddressBookStub(newPersons);
Expand All @@ -73,7 +73,7 @@ public void hasPerson_personInAddressBook_returnsTrue() {
@Test
public void hasPerson_personWithSameIdentityFieldsInAddressBook_returnsTrue() {
addressBook.addPerson(ALICE);
Person editedAlice = new PersonBuilder(ALICE).withAddress(VALID_ADDRESS_BOB).withTags(VALID_TAG_HIGH_RISK)
Person editedAlice = new PersonBuilder(ALICE).withAddress(VALID_ADDRESS_BOB).withTag(VALID_TAG_HIGH_RISK)
.build();
assertTrue(addressBook.hasPerson(editedAlice));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ public void test_nameDoesNotContainKeywords_returnsFalse() {
assertFalse(predicate.test(new PersonBuilder().withName("Alice Bob").build()));

// Keywords match phone, email and address, but does not match name
predicate = new NameContainsKeywordsPredicate(Arrays.asList("12345", "[email protected]", "Main", "Street"));
assertFalse(predicate.test(new PersonBuilder().withName("Alice").withPhone("12345")
predicate = new NameContainsKeywordsPredicate(Arrays.asList("98765432", "[email protected]", "Main", "Street"));
assertFalse(predicate.test(new PersonBuilder().withName("Alice").withPhone("98765432")
.withEmail("[email protected]").withAddress("Main Street").build()));
}

Expand Down
3 changes: 3 additions & 0 deletions src/test/java/seedu/address/model/person/NameTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ public void equals() {
// same object -> returns true
assertTrue(name.equals(name));

//same name different capitalization -> returns true
assertTrue(name.equals(new Name("valid name")));

// null -> returns false
assertFalse(name.equals(null));

Expand Down
28 changes: 18 additions & 10 deletions src/test/java/seedu/address/model/person/PersonTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,26 @@ public void isSamePerson() {
// null -> returns false
assertFalse(ALICE.isSamePerson(null));

// same name, all other attributes different -> returns true
// same name, all other attributes different -> returns false
Person editedAlice = new PersonBuilder(ALICE).withPhone(VALID_PHONE_BOB).withEmail(VALID_EMAIL_BOB)
.withAddress(VALID_ADDRESS_BOB).withTags(VALID_TAG_HIGH_RISK).build();
assertTrue(ALICE.isSamePerson(editedAlice));
.withAddress(VALID_ADDRESS_BOB).withTag(VALID_TAG_HIGH_RISK).build();
assertFalse(ALICE.isSamePerson(editedAlice));

// different name, all other attributes same -> returns false
// different name, phone number same -> returns false
editedAlice = new PersonBuilder(ALICE).withName(VALID_NAME_BOB).build();
assertFalse(ALICE.isSamePerson(editedAlice));

// name differs in case, all other attributes same -> returns false
//different people -> returns false
assertFalse(ALICE.isSamePerson(BOB));

// name differs in case, all other attributes same -> returns true
Person editedBob = new PersonBuilder(BOB).withName(VALID_NAME_BOB.toLowerCase()).build();
assertFalse(BOB.isSamePerson(editedBob));
assertTrue(BOB.isSamePerson(editedBob));

//same name, same phone number, all other attributes different -> returns true
editedAlice = new PersonBuilder(ALICE).withEmail(VALID_EMAIL_BOB).withAddress(VALID_ADDRESS_BOB)
.withTag(VALID_TAG_HIGH_RISK).build();
assertTrue(ALICE.isSamePerson(editedAlice));

// name has trailing spaces, all other attributes same -> returns false
String nameWithTrailingSpaces = VALID_NAME_BOB + " ";
Expand Down Expand Up @@ -81,7 +89,7 @@ public void equals() {
assertFalse(ALICE.equals(editedAlice));

// different tags -> returns false
editedAlice = new PersonBuilder(ALICE).withTags(VALID_TAG_LOW_RISK).build();
editedAlice = new PersonBuilder(ALICE).withTag(VALID_TAG_LOW_RISK).build();
assertFalse(ALICE.equals(editedAlice));

}
Expand All @@ -99,13 +107,13 @@ public void hashCode_differentPersons_differentHashCode() {
@Test
public void constructor_allFieldsPresent_success() {
Person person = new PersonBuilder().withName("Charlie")
.withPhone("12345678")
.withPhone("98765432")
.withEmail("[email protected]")
.withAddress("123, Charlies Street")
.withTags("Medium Risk").build();
.withTag("Medium Risk").build();

assertEquals("Charlie", person.getName().toString());
assertEquals("12345678", person.getPhone().toString());
assertEquals("98765432", person.getPhone().toString());
assertEquals("[email protected]", person.getEmail().toString());
assertEquals("123, Charlies Street", person.getAddress().toString());
assertEquals("Medium Risk", person.getTag().toString());
Expand Down
24 changes: 9 additions & 15 deletions src/test/java/seedu/address/model/person/PhoneTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,9 @@ public void constructor_invalidPhone_throwsIllegalArgumentException() {

@Test
public void constructor_validPhone_withSpaces() {
Phone phoneWithSpaces = new Phone(" 911 ");
assertTrue(phoneWithSpaces.equals(new Phone("911"))); // Should equal the trimmed version

Phone longPhoneWithSpaces = new Phone(" 93121534 ");
assertTrue(longPhoneWithSpaces.equals(new Phone("93121534"))); // Should equal the trimmed version

Phone mixedSpaces1 = new Phone(" 1234 5678 ");
assertTrue(mixedSpaces1.equals(new Phone("12345678")));

Phone mixedSpaces2 = new Phone(" 98 76 54 32 ");
assertTrue(mixedSpaces2.equals(new Phone("98765432")));
}
Expand All @@ -43,24 +37,24 @@ public void isValidPhone() {
// invalid phone numbers
assertFalse(Phone.isValidPhone("")); // empty string
assertFalse(Phone.isValidPhone(" ")); // spaces only
assertFalse(Phone.isValidPhone("91")); // less than 3 numbers
assertFalse(Phone.isValidPhone("91")); // less than 8 numbers
assertFalse(Phone.isValidPhone("phone")); // non-numeric
assertFalse(Phone.isValidPhone("9011p041")); // alphabets within digits
assertFalse(Phone.isValidPhone("9312 1534")); // spaces within digits
assertFalse(Phone.isValidPhone(" 9312 1534 ")); //spaces around digits
assertFalse(Phone.isValidPhone("124293842033123")); // more than 8 digits

// valid phone numbers
assertTrue(Phone.isValidPhone("911")); // exactly 3 numbers
assertTrue(Phone.isValidPhone("93121534"));
assertTrue(Phone.isValidPhone("124293842033123")); // long phone numbers
assertTrue(Phone.isValidPhone("93121534")); //phone number starts with 9
assertTrue(Phone.isValidPhone("83121534")); //phone number starts with 8
assertTrue(Phone.isValidPhone("63121534")); //phone number starts with 6
assertTrue(Phone.isValidPhone("33121534")); //phone number starts with 3
}

@Test
public void equals() {
Phone phone = new Phone("999");
Phone phone = new Phone("98765432");

// same values -> returns true
assertTrue(phone.equals(new Phone("999")));
assertTrue(phone.equals(new Phone("98765432")));

// same object -> returns true
assertTrue(phone.equals(phone));
Expand All @@ -72,6 +66,6 @@ public void equals() {
assertFalse(phone.equals(5.0f));

// different values -> returns false
assertFalse(phone.equals(new Phone("995")));
assertFalse(phone.equals(new Phone("97654321")));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public void contains_personInList_returnsTrue() {
@Test
public void contains_personWithSameIdentityFieldsInList_returnsTrue() {
uniquePersonList.add(ALICE);
Person editedAlice = new PersonBuilder(ALICE).withAddress(VALID_ADDRESS_BOB).withTags(VALID_TAG_HIGH_RISK)
Person editedAlice = new PersonBuilder(ALICE).withAddress(VALID_ADDRESS_BOB).withTag(VALID_TAG_HIGH_RISK)
.build();
assertTrue(uniquePersonList.contains(editedAlice));
}
Expand Down Expand Up @@ -85,7 +85,7 @@ public void setPerson_editedPersonIsSamePerson_success() {
@Test
public void setPerson_editedPersonHasSameIdentity_success() {
uniquePersonList.add(ALICE);
Person editedAlice = new PersonBuilder(ALICE).withAddress(VALID_ADDRESS_BOB).withTags(VALID_TAG_HIGH_RISK)
Person editedAlice = new PersonBuilder(ALICE).withAddress(VALID_ADDRESS_BOB).withTag(VALID_TAG_HIGH_RISK)
.build();
uniquePersonList.setPerson(ALICE, editedAlice);
UniquePersonList expectedUniquePersonList = new UniquePersonList();
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/seedu/address/testutil/PersonBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public PersonBuilder withName(String name) {
/**
* Parses the {@code tags} into a {@code Set<Tag>} and set it to the {@code Person} that we are building.
*/
public PersonBuilder withTags(String tag) {
public PersonBuilder withTag(String tag) {
this.tag = new Tag(tag);
return this;
}
Expand Down
20 changes: 10 additions & 10 deletions src/test/java/seedu/address/testutil/TypicalPersons.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,33 +26,33 @@ public class TypicalPersons {
public static final Person ALICE = new PersonBuilder().withName("Alice Pauline")
.withAddress("123, Jurong West Ave 6, #08-111").withEmail("[email protected]")
.withPhone("94351253")
.withTags("High Risk").build();
.withTag("High Risk").build();
public static final Person BENSON = new PersonBuilder().withName("Benson Meier")
.withAddress("311, Clementi Ave 2, #02-25")
.withEmail("[email protected]").withPhone("98765432")
.withTags("High Risk").build();
.withTag("High Risk").build();
public static final Person CARL = new PersonBuilder().withName("Carl Kurz").withPhone("94351253")
.withEmail("[email protected]").withAddress("wall street").build();
public static final Person DANIEL = new PersonBuilder().withName("Daniel Meier").withPhone("87652533")
.withEmail("[email protected]").withAddress("10th street").withTags("Low Risk").build();
.withEmail("[email protected]").withAddress("10th street").withTag("Low Risk").build();
public static final Person ELLE = new PersonBuilder().withName("Elle Meyer").withPhone("94822242")
.withEmail("[email protected]").withAddress("michegan ave").withTags("Low Risk").build();
.withEmail("[email protected]").withAddress("michegan ave").withTag("Low Risk").build();
public static final Person FIONA = new PersonBuilder().withName("Fiona Kunz").withPhone("94824272")
.withEmail("[email protected]").withAddress("little tokyo").withTags("Low Risk").build();
.withEmail("[email protected]").withAddress("little tokyo").withTag("Low Risk").build();
public static final Person GEORGE = new PersonBuilder().withName("George Best").withPhone("94824422")
.withEmail("[email protected]").withAddress("4th street").withTags("Low Risk").build();
.withEmail("[email protected]").withAddress("4th street").withTag("Low Risk").build();

// Manually added
public static final Person HOON = new PersonBuilder().withName("Hoon Meier").withPhone("84824242")
.withEmail("[email protected]").withAddress("little india").withTags("High Risk").build();
.withEmail("[email protected]").withAddress("little india").withTag("High Risk").build();
public static final Person IDA = new PersonBuilder().withName("Ida Mueller").withPhone("84821312")
.withEmail("[email protected]").withAddress("chicago ave").withTags("High Risk").build();
.withEmail("[email protected]").withAddress("chicago ave").withTag("High Risk").build();

// Manually added - Person's details found in {@code CommandTestUtil}
public static final Person AMY = new PersonBuilder().withName(VALID_NAME_AMY).withPhone(VALID_PHONE_AMY)
.withEmail(VALID_EMAIL_AMY).withAddress(VALID_ADDRESS_AMY).withTags(VALID_TAG_LOW_RISK).build();
.withEmail(VALID_EMAIL_AMY).withAddress(VALID_ADDRESS_AMY).withTag(VALID_TAG_LOW_RISK).build();
public static final Person BOB = new PersonBuilder().withName(VALID_NAME_BOB).withPhone(VALID_PHONE_BOB)
.withEmail(VALID_EMAIL_BOB).withAddress(VALID_ADDRESS_BOB).withTags(VALID_TAG_HIGH_RISK)
.withEmail(VALID_EMAIL_BOB).withAddress(VALID_ADDRESS_BOB).withTag(VALID_TAG_HIGH_RISK)
.build();

public static final String KEYWORD_MATCHING_MEIER = "Meier"; // A keyword that matches MEIER
Expand Down

0 comments on commit 7ac000a

Please sign in to comment.