Skip to content

Commit

Permalink
Merge pull request AY2324S2-CS2103T-T08-1#71 from laney0808/fix-non-c…
Browse files Browse the repository at this point in the history
…ompilling-code

Fix miscellaneous details
  • Loading branch information
laney0808 authored Mar 21, 2024
2 parents a3076ae + 2221cf3 commit 4fcc8f8
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public class FindCommand extends Command {
+ "Example: " + COMMAND_WORD + " alice bob charlie";

private final NameContainsKeywordsPredicate predicate;
//TODO: add nric contains keywords

public FindCommand(NameContainsKeywordsPredicate predicate) {
this.predicate = predicate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ public CommandResult execute(Model model) throws CommandException {

boolean personNotFound = true;
Person personToUpdate = null;
//TODO: change to new method to get person by nric
for (Person p : lastShownList) {
if (p.getNric().equals(nric)) {
personToUpdate = p;
Expand Down
14 changes: 12 additions & 2 deletions src/main/java/seedu/address/model/person/Person.java
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ public boolean isSamePerson(Person otherPerson) {
}

/**
* Returns true if both persons have the same identity and data fields.
* Returns true if both persons have the same identity and all data fields.
* This defines a stronger notion of equality between two persons.
*/
@Override
Expand All @@ -241,7 +241,17 @@ public boolean equals(Object other) {
&& phone.equals(otherPerson.phone)
&& address.equals(otherPerson.address)
&& dateOfBirth.equals(otherPerson.dateOfBirth)
&& sex.equals(otherPerson.sex);
&& sex.equals(otherPerson.sex)
&& status.equals(otherPerson.status)
&& tags.equals(otherPerson.tags)
&& email.equals(otherPerson.email)
&& country.equals(otherPerson.country)
&& allergies.equals(otherPerson.allergies)
&& bloodType.equals(otherPerson.bloodType)
&& condition.equals(otherPerson.condition)
&& dateOfAdmission.equals(otherPerson.dateOfAdmission)
&& diagnosis.equals(otherPerson.diagnosis)
&& symptom.equals(otherPerson.symptom);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ public class CommandTestUtil {
public static final String VALID_COUNTRY_BOB = "Indonesia";
public static final String VALID_ALLERGIES_AMY = "peanuts";
public static final String VALID_ALLERGIES_BOB = "pollen";
public static final String[] VALID_BLOODTYPE_AMY = new String[]{"B", "POSITIVE"};
public static final String[] VALID_BLOODTYPE_BOB = new String[]{"B", "POSITIVE"};
public static final String VALID_BLOODTYPE_AMY = "B+";
public static final String VALID_BLOODTYPE_BOB = "B+";
public static final String VALID_CONDITION_AMY = "diabetes";
public static final String VALID_CONDITION_BOB = "high blood pressure";
public static final String VALID_DATEOFADMISSION_AMY = "2023-01-01";
Expand Down

0 comments on commit 4fcc8f8

Please sign in to comment.