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

As a dev, I want to ensure phone numbers are correctly formatted and websites are verified on the backend. #41

Open
SamuelPelletierEvraire opened this issue Sep 24, 2024 · 0 comments · May be fixed by #50
Assignees
Labels
bug Something isn't working

Comments

@SamuelPelletierEvraire
Copy link
Contributor

SamuelPelletierEvraire commented Sep 24, 2024

Description

Phone numbers returned by the backend are not consistently formatted, resulting in outputs with letters or various formats. For example: 413-334-OEUI or 413.334.5564 or (413) 334-4464. I identified at least eight different formats for phone numbers. Additionally, website URLs often need modification because "www." is missing or extra text is included, such as www.fertiscan.caproduitbrut instead of www.fertiscan.ca.

Bug Summary:
Phone numbers returned by the backend are inconsistently formatted and sometimes contain letters. Website URLs often include improper formatting or extra text.

Steps to Reproduce:

  1. Login into the app.
  2. Analyse picture give in this issue.
  3. See the result into the phone number field and website field.

Expected Behaviour:
Phone numbers should be consistently formatted and free of letters. Website URLs should be correctly formatted with no missing "www." prefix or extra text.

Phone format needed: 514-702-6657

Actual Behaviour:
Phone numbers appear in various formats and sometimes contain letters. Website URLs often need manual correction due to improper formatting.

Environment:

Commit Hash:

OS Version:
Windows 10

Browser Version:
Chrome Version: 129.0.6668.59 (Build officiel) (64 bits)

Logs and Screenshots:
No data for website didn't succeed to recreate the issue
Follow this link to access the phone data folder

Browser Console Logs:

Extra Screenshots:

Additional Context:
The variety in phone number formats and the improper formatting of URLs can lead to confusion and data inconsistency.

Suggested Fix:

  1. Phone Number Formatting:

    • Implement a consistent formatting rule for phone numbers on the backend.
    • Use regular expressions to detect and format phone numbers correctly, ensuring they do not contain any letters.
    • Standardize the phone number format to one style (e.g., XXX XXX-XXXX).
  2. Website URL Verification:

    • Implement a simple validation and correction mechanism for website URLs on the backend.
    • Use a regular expression to check for and add missing "www." prefixes if needed.
    • Strip any extra text from the URLs to ensure they conform to standard formats.
    • Optionally, use a ping or similar network request to verify that the URLs are reachable and correctly formatted.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: In review
Development

Successfully merging a pull request may close this issue.

3 participants