mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-24 09:21:39 -05:00
This uses the `format_phone_number` method from utils to output phone numbers in a consistent format. It is added to the schemas, so will be applied before the API tries to do anything with a provided phone number. So now the API will accept any of the following: - 07123456789 - 07123 456789 - 07123-456-789 - 00447123456789 - 00 44 7123456789 - +447123456789 - +44 7123 456 789 - +44 (0)7123 456 789 …but the API will always hand off phone numbers to 3rd party APIs in the format - +447123456789 The test for this is slightly convoluted, because template IDs are still database IDs, and can’t consistently be mocked, therefore we have to ignore that part of the call to `encrypt()`.