Skip to content

Move phone number validation to a distinct module

Vincent Agnano requested to merge phone-number-validation into recette

Created by: n-b

Je dépile des commits et des notes que j’ai en local; certaines méritent sans doute des issues, pour les autres je vais faire des petites PR.


Fix sms that could not be sent to DROM numbers even though they were valid and mobile.

Since we were directly calling Phonelib.parse in application_sms and notificable_concern, a valid mobile phone number in e.g. La Réunion would not actually work: sms would not actually be sent.

  • Gather all the parsing, validation and mobile identification in a single module;
  • Separate that logic from the activemodel hooks; make the hooks a distinct concern.

refs #1753

Checklist avant review:

  • reparcourir le code rapidement pour voir les problèmes évidents (fichiers touchés inutilement, debug logs qui trainent…).
  • Tester la fonctionnalité sur la review app

Merge request reports