nus-cs2103-AY2324S1 / pe-dev-response

0 stars 0 forks source link

Inadequate parsing of phone number for add command #5359

Open nus-se-script opened 11 months ago

nus-se-script commented 11 months ago

image.png In the given example, a phone number "123" is allowed as a phone number for an employee. This is unrealistic as "123" is not a valid phone number. This could lead to issues whereby a HR manager could mistype a phone number and the application does not catch the mistake. Perhaps better parsing of the phone number can be implemented!


[original: nus-cs2103-AY2324S1/pe-interim#4950] [original labels: type.FunctionalityBug severity.Medium]

nixonwidjaja commented 11 months ago

Team's Response

Thank you for your suggestion! Yes, we acknowledge that 123 is not a valid phone number in Singapore, but we want to make HRInsight as general and usable as possible. Following this link, we have an example of 4-digit dialing number in Jamestown, and the longest phone number in the world is 15 digits. To account for this, we decided to restrict the phone number constraint to be between 3 and 20 digits as a "buffer", if you will. We also allow + sign in front of the phone number to account for international numbers.

Duplicate status (if any):

--