safe-refuge / safeway-data

Data mining tools for the Safeway app
4 stars 4 forks source link

Normalize phone numbers #43

Closed littlepea closed 2 years ago

littlepea commented 2 years ago

And about 'Phone numbers'. Few of them are like: "tel. 54 280 96 50" I'm not sure if the App will be happy with it. And it should have a country code as a prefix. We have a 'phone dial' button in the app that will try to use this field.

littlepea commented 2 years ago

I suggest we structure it the same as #42 - just add a validator to PointOfInterest model

idisblueflash commented 2 years ago

How should we handle the multiple phones? we can:

  1. keep only the first one
  2. keep all phones and left FrontEnd to handle In Poland RJPS, there's 5% are multiple phones Screenshot 2022-06-21 at 21 02 53
littlepea commented 2 years ago

@idisblueflash good question! I've forwarded it to the person responsible for the back-end

My guess would be to just keep the first number and append \n\n Other phone numbers: ... to the description

idisblueflash commented 2 years ago

My guess would be to just keep the first number and append \n\n Other phone numbers: ... to the description

Done in our code

idisblueflash commented 2 years ago

How about we ignore the edge case like below? Since we're ok if we take the first phone number only.

And for inputs of phone number 17 7445715 7445717 7445756 we should parse it as 17 7445715, 17 7445717, and 17 7445756 since the internal phone number of Poland is 9 digital, and 17 could be the area code, thus in 7445717 7445756, the people who input ignored the area code.

It'll take time to add this in, so I prefer to ignore it, but we can enhance it later if we want.

littlepea commented 2 years ago

I think it's ok to ignore it, but will you be able to parse the first number 17 7445715 correctly? (and with the country code)

littlepea commented 2 years ago

Tagging @ahik for visibility

idisblueflash commented 2 years ago

but will you be able to parse the first number 17 7445715 correctly?

yes But the second will be wrong, 17 7445715 7445717 7445756 -> 17 7445715, 744571774, and 45756 will be removed