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

Update phone parsing #172

Conversation

Andrew22Teoh
Copy link
Collaborator

@Andrew22Teoh Andrew22Teoh commented Nov 1, 2024

This PR does two things simultaneously.

First, it allows phone numbers to have whitespace in the middle between 2 groups of 4 numbers.
This is in line with how we had originally envisioned the way that phone numbers should be parsed, and it also makes sense from a human readability point of view. However, spaces in unexpected places will not be allowed.
Thus, 9112 3942, 91123942, and even 9112 3942 are allowed, but 911 23942 will not be allowed.
Closes #149

Secondly, it requires the first digit of the phone number to be a 6, 8, or 9. This is because we have scoped SocialBook to be for social workers in Singapore, and so any "phone number" entered by users that does not begin with those numbers must be a typo, so we want the error to notify them of it.
Closes #168

Tests have been updated accordingly, as has the user guide. For further clarification on the multiple fields we are adding, I have also created a new section in the user guide Contact field requirements, where we can specify the detailed requirements on any contact fields that aren't obvious. This might be related to the intention of #153, but I'm not sure if this is what the suggestion meant, so do let me know if this would be fine.

@Andrew22Teoh Andrew22Teoh added type.Enhancement An enhancement to an existing story priority.Medium Nice to have severity.Medium A flaw that causes occasional inconvenience to some users, but they can continue to use the product. alpha-bug labels Nov 1, 2024
Copy link

codecov bot commented Nov 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Files with missing lines Coverage Δ Complexity Δ
...rc/main/java/seedu/address/model/person/Phone.java 92.85% <ø> (ø) 6.00 <0.00> (ø)

Copy link

@Rachael-Chan Rachael-Chan left a comment

Choose a reason for hiding this comment

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

LGTM!

@Rachael-Chan Rachael-Chan merged commit 4c6644b into AY2425S1-CS2103-F10-2:master Nov 1, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
alpha-bug priority.Medium Nice to have severity.Medium A flaw that causes occasional inconvenience to some users, but they can continue to use the product. type.Enhancement An enhancement to an existing story
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Extra validation for phone numbers Overzealousness of phone number parsing
3 participants