sora-xor / sora-card

Designing a Better World Through Decentralized Technologies
4 stars 1 forks source link

Phone number format normalisation #100

Closed bgodlin closed 1 year ago

bgodlin commented 1 year ago

Problem

The way users enter phone numbers isn't ideal right now. Also, there's no check to make sure the numbers entered are unique, so people could register two accounts with the same phone number by typing it with or without a zero.

Solution

Extra checks as well as the enhanced UX have to be added to prevent this.

Requirements

Upon accessing the relevant screen, the application should initiate a call to the provided endpoint to retrieve and display a list of countries, enabling users to view the country flags and automatically populate the code. After selecting a country, user should input their phone number in a separate field without the country code. This field will exclusively accept numeric digits, and if a zero is entered as the first digit, it should be automatically removed when sending an SMS request.

sequenceDiagram
    participant User
    participant Application
    participant Endpoint
    participant SMS Gateway

    User->>Application: Access relevant screen
    Application->>Endpoint: Call to fetch country codes
    Endpoint->>Application: List of countries
    Application->>User: Display country flags and codes
    User->>Application: Select a country
    User->>Application: Input phone number without code
    Application->>SMS Gateway: Send SMS request (with 0 digit removal if needed)
    SMS Gateway-->>User: SMS sent

Sub-Tasks

Backend

Applications

Web

Mobile

ab10001 commented 1 year ago

Mobile: https://www.figma.com/file/XhTyv6TrsoVXRDlO7Ud9mS/%F0%9F%94%A8-SORA-Wallet-(in-Development)?type=design&node-id=5734%3A1506&mode=design&t=fQX70aI9Dcd3gRfP-1

Web: https://www.figma.com/file/aDkwf6C8zmyJjudJOuuhrH/Polkaswap-v1.x.x-(Current)?type=design&node-id=17680%3A38104&mode=design&t=Yz2zMS5ynWmj5xIs-1