AY2425S1-CS2103T-F14A-3 / tp

https://ay2425s1-cs2103t-f14a-3.github.io/tp/
MIT License
0 stars 5 forks source link

[PE-D][Tester A] Allowing Invalid Phone Number Format in add Command #226

Closed nus-pe-script closed 6 days ago

nus-pe-script commented 1 week ago

The Clientele+ application allows adding clients with phone numbers that do not follow standard formatting. For instance, a phone number like 00000000 was accepted, even though such a number is not a realistic or valid contact. This issue may result in storing unusable or incorrect contact information, which could hinder communication with clients.

Steps to Reproduce Open the Clientele+ application. Add a new client using the following command: add n/John meow p/00000000 e/johnmeow@gmail.com a/Maxwell Street, #05-01 t/JP Morgan t/CTO ps/in progress py/pending cs/active d/09-09-2024 Observe that the client is successfully added with 00000000 as the phone number.

Expected Behavior The application should validate phone numbers to ensure they follow standard formats. For example, it should check that the phone number:

Contains a non-trivial, realistic number sequence (not all zeros). Meets typical phone number length requirements (e.g., 8 to 15 digits). A suitable error message could be:

"Invalid phone number format. Please enter a valid phone number."

Actual Behavior The application accepts the input 00000000 without any validation or error message, resulting in a client entry with an invalid phone number.

Screenshot

Screenshot 2024-11-08 at 5.44.34 PM.png

Suggested Improvement Implement phone number validation that checks for realistic formats, such as:

Rejecting phone numbers with all identical digits (e.g., 00000000, 11111111). Enforcing a minimum length (e.g., 8 digits). Ensuring the phone number is composed of valid numeric characters without unusual patterns. This would improve data quality by ensuring only valid contact information is stored.


Labels: severity.Medium type.FunctionalityBug original: AlekKwek18/ped#3

rahula1008 commented 6 days ago

Duplicate bug. Same as #229