entity
entity copied to clipboard
Legal API: (Incorporation Application) Contact Info phone number API validation mismatches
As an API user posting an incorporation application, I want to get appropriate validation errors if I try and put a field in that has a contact point phone number that would not be allowed through the frontend, so that my saved data is accurate and reliable and will not cause issues if used again through the frontend
- The frontend doesn't validate a phone number in the Contact Information, but it forces a mask on the format so it will always enter as (123) 456-7890. But on the API you can do other formats than that, so a FE user can only enter a certain phone format but API could end up different.
- The Extension, if posted through the API limits to a number, and 5 digits, but you can put a negative number in (frontend restricts to just numeric characters)
- The API does check phone number length, but even if you put too short, or some other validation error it tells you "Invalid phone number, maximum 10 digits in phone number format." So the caller may not know acceptable formats (though the spec does state "eg: (250) 234-4433, maximum 10 digits")
Dev Notes
frontend will always force (123) 456-7898 (with an optional ext)
backend regex allows (validate_phone_number in common_validations) other formats
Ex: # (123) 456-7890 / 123-456-7890 / 123.456.7890 / 123 456 7890
QA Notes
- Regression of Incorporation Application, the contact point info saves and files as expected
- The optionality of the phone number remains
- The auto-formatting of the phone number on the frontend still works as before
- When calling through the API to do an IA (postman collection) phone number entry still works
- Supplying an invalid format phone number through the postman collection returns an expected validation error
- The phone number extension validates as expected, can't supply too many digits or a negative number