zio-schema icon indicating copy to clipboard operation
zio-schema copied to clipboard

Add phone number validations for European countries

Open jdegoes opened this issue 2 years ago • 8 comments

ISSUE

There is no constructor for zio.schema.validation.Validation which can validate a European country phone number.

NOTE: This is 50 tickets in one. Please signup for one or more of the tickets by checking them below.

  • [ ] Albania
  • [ ] Andorra
  • [ ] Armenia
  • [ ] Austria
  • [ ] Azerbaijan
  • [ ] Belarus
  • [ ] Belgium
  • [ ] Bosnia and Herzegovina
  • [ ] Bulgaria
  • [ ] Croatia
  • [ ] Cyprus
  • [ ] Czechia
  • [ ] Denmark
  • [ ] Estonia
  • [ ] Finland
  • [ ] France
  • [ ] Georgia
  • [ ] Germany
  • [ ] Greece
  • [ ] Hungary
  • [ ] Iceland
  • [ ] Ireland
  • [ ] Italy
  • [ ] Kazakhstan
  • [ ] Kosovo
  • [ ] Latvia
  • [ ] Liechtenstein
  • [ ] Lithuania
  • [ ] Luxembourg
  • [ ] Malta
  • [ ] Moldova
  • [ ] Monaco
  • [ ] Montenegro
  • [ ] Netherlands
  • [ ] North Macedonia
  • [ ] Norway
  • [ ] Poland
  • [ ] Portugal
  • [ ] Romania
  • [ ] Russia
  • [ ] San Marino
  • [ ] Serbia
  • [ ] Slovakia
  • [ ] Slovenia
  • [ ] Spain
  • [ ] Sweden
  • [ ] Switzerland
  • [ ] Turkey
  • [ ] Ukraine
  • [ ] Vatican City (Holy See)

SOLUTION

Using other constructors which already exist in zio.schema.validation.Validation (which include regex validation, string length checking, and numeric range checking), introduce a new constructor that satisfies the requirements of this issue.

object Validation {
  ...
  val phoneNumber<2-Letter CountryCode>: Validation[String] = ???
}

IMPACT

Increasing the number of constructors for Validation will make it far easier to use the validation package to

WHERE TO LOOK

PROBLEMATIC ISSUES

Issue #248 must be completed first, or at least, this issue must be based off of #244.

jdegoes avatar May 25 '22 19:05 jdegoes

I'll try to get that one started by implementing Switzerland, but once I got the hang of it, I can continue with other countries too.

BalduinLandolt avatar May 26 '22 12:05 BalduinLandolt

I'll try to get into this as well and will start with Germany.

marioaae avatar May 26 '22 12:05 marioaae

@marioaae should we pair up, maybe? If you want to, just ping me on discord (I posted in the zio-schema channel, so you should easily be able to find me)

BalduinLandolt avatar May 26 '22 12:05 BalduinLandolt

I will try Serbia.

subotic avatar May 26 '22 14:05 subotic

I will try Portugal.

lmserrano avatar May 26 '22 15:05 lmserrano

I will do Hungary.

tewecske avatar May 27 '22 14:05 tewecske

This ticket needs to be updated to reflect which validators have already been implemented, and which remain.

jdegoes avatar Oct 24 '22 16:10 jdegoes

I can't update the initial task, but I went through the list: all of the validations (and many more) are done, so this issue can be closed, I suppose.
(Only thing I noticed, in the comment the republic of North Macedonia is referred to as the republic of Macedonia, which isn't the official name any more.)

BalduinLandolt avatar Oct 26 '22 19:10 BalduinLandolt