Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust person duplicate #222

Conversation

choiwab
Copy link

@choiwab choiwab commented Nov 5, 2024

FIxes #198

Adjust person duplication detection:
-phone number and name has to be the same
-name is case-insensitive and whitespace-insensitive

@choiwab choiwab added this to the v1.5 milestone Nov 5, 2024
@choiwab choiwab requested a review from jayjay19630 November 5, 2024 12:25
@choiwab choiwab self-assigned this Nov 5, 2024
Copy link

codecov bot commented Nov 5, 2024

Codecov Report

Attention: Patch coverage is 83.33333% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...a/seedu/address/model/person/PersonDescriptor.java 75.00% 0 Missing and 1 partial ⚠️
Files with missing lines Coverage Δ Complexity Δ
src/main/java/seedu/address/model/person/Name.java 100.00% <100.00%> (ø) 8.00 <0.00> (ø)
...a/seedu/address/model/person/PersonDescriptor.java 90.69% <75.00%> (-1.99%) 24.00 <0.00> (+1.00) ⬇️

... and 1 file with indirect coverage changes

Copy link

@jayjay19630 jayjay19630 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Just make sure to resolve the merge conflicts and we should be able to merge this in.

Comment on lines -38 to +45
// 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).withStatus(VALID_STATUS_BOB).withTags(VALID_TAG_HUSBAND).build();
assertTrue(ALICE.isSamePerson(editedAlice));
assertFalse(ALICE.isSamePerson(editedAlice));

// same name, same phone, all other attributes different -> returns true
Person editedAliceNewPhone = new PersonBuilder(ALICE).withEmail(VALID_EMAIL_BOB)
.withAddress(VALID_ADDRESS_BOB).withStatus(VALID_STATUS_BOB).withTags(VALID_TAG_HUSBAND).build();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for updating the test cases to consider the new valid inputs!

Copy link

@jayjay19630 jayjay19630 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jayjay19630 jayjay19630 merged commit c7c07fe into AY2425S1-CS2103T-W10-2:master Nov 6, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Person duplicate detection
2 participants