-
Notifications
You must be signed in to change notification settings - Fork 35
Add DUNS number validation on profile page #425
Comments
One issue I am having with this is that we have a trait in our factories:
I see that this duns_number is also in @adelevie @harrisj do you know the history behind this special ❄️ duns? Is it the only one that won't start with a 0? |
I take that back, there are other DUNs numbers in there that do not start with 0. Perhaps they were entered incorrectly in pre-validation times? |
ah ha! it looks like formatting is slightly more complicated than we thought: https://github.com/18f/samwise/tree/micropurchase-compatibility#format-a-duns-number must start with 0 if it is 8 digits! |
Oh nice. @jessieay, I will talk about Cucumber tomorrow with you |
@mtorres253 if you see my comment above, the formatting referenced in the original GH issue description is not accurate. Will move forward with formatting validation but error msg and rules will be different. |
@jessieay Let's just check to see if it is a number. I don't want to build duplicate validation logic in our system when there is an API we can use to validate the format of the number. I'll add a separate story for that integration. |
Did the docs/code in |
Maybe @adelevie @jessieay . According to
This story started out as a simple validation to ensure that the user is entering a number, so I'm fine just going back to that, and implementing the other checks later in another story. |
👍 |
* Validate that it contains only integers * Validate that it is between 8 and 13 characters long #425
PR for validating that it's only numbers and between 8 and 13 characters is here: #438 |
* Validate that it contains only integers * Validate that it is between 8 and 13 characters long #425
* Validate that it contains only integers * Validate that it is between 8 and 13 characters long #425
* Use samwise to validate format * Validate that it contains only integers #425
* Use samwise to validate format * Validate that it contains only integers #425
* Use samwise to validate format * Validate that it contains only integers #425
* Use samwise to validate format * Validate that it contains only integers #425
closed via #445 |
Based on my read of #445, it looks like it doesn't matter, but I thought you should know (because I didn't!) that there are valid seven-digit DUNS numbers. See 18F/samwise#15. |
@vzvenyach Thank you for pointing that out. We are using samwise to format so it looks like 7 digits does work:
But, the samwise README does not reflect this: https://github.com/18f/samwise/tree/micropurchase-compatibility#format-a-duns-number will do a PR to the README to clarify |
Nice! Thanks @jessieay! |
As a registered vendor, I want to know whether the DUNS number I've entered for my profile is not formatted correctly, so that I can correct it before it gets saved to my profile, so the system should check to see if it is correctly formatted
Scenario: System checks that value for DUNS number is actually a number
Given that I am a registered vendor
And I have entered a DUNS number on my profile page
And the DUNS number is not formatted properly (it needs to be a number)
When I click the "Save" button
I should see an error message "The DUNS number you have entered is invalid: The value for this field has to be a number")
And my DUNS number should not be saved to my profile
The text was updated successfully, but these errors were encountered: