Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NL Postal codes should not allow left padding, and can not start with a 0 #73

Closed
Cerbrus opened this issue Oct 8, 2019 · 6 comments
Closed

Comments

@Cerbrus
Copy link
Contributor

Cerbrus commented Oct 8, 2019

Currently, these postal codes pass validation:

0011aa
11 (This gets left-padded to 0011)

The numeric part of Dutch postal codes should follow the format [1-9][0-9]{3}, so at very least, the left-padding should be disabled.

The regex is implemented correctly in postal-codes-js:

https://github.com/Cimpress-MCP/postal-codes-js/blob/master/formats/NL.json

@Cerbrus
Copy link
Contributor Author

Cerbrus commented Oct 10, 2019

@istanishev would it be possible to get a response on this issue and the related pull request?

If this can't be implemented, that's okay, but then I'll have to handle those cases separately.

Thanks for your time and this very useful library 🥇

@Igrom
Copy link

Igrom commented Oct 10, 2019

@Cerbrus First of all, thanks a lot for contributing to the project. I'm very happy to hear that you are drawing benefit from using the library.

I lack knowledge of subject matter to review the PR and @istanishev is away on holiday this week. I'll try to refer him here, but cannot vouch for him reading the message before the week is over. I'll also notify other maintainers.

@Cerbrus
Copy link
Contributor Author

Cerbrus commented Oct 10, 2019

@Igrom Thanks for the update. Knowing that there's not likely to be an merge this week helps, that's something I can communicate on my side :-)

@mmaruniak
Copy link
Contributor

@Cerbrus the change looks good to me. Did you notice the failed pipeline?

@Cerbrus
Copy link
Contributor Author

Cerbrus commented Oct 11, 2019

@mmaruniak I did, and I mentioned that on the pull request:

Apparently there are some unit tests in place that consider postal codes starting with a 0 to be valid. I'm not too sure how to update those tests without breaking other cases, since I can't get the project to run locally ("NuGet exited with code 3")

mmaruniak pushed a commit that referenced this issue Oct 16, 2019
* Fixed Dutch postal code validation.

This resolves issue #73

- Disabled left-padding on Dutch postal codes.
- Dutch postal codes can not start with a `0`.
- Dutch postal codes can not contain `SA`, `SS` or `SD`.

* Update NL Postal codes source file

* Corrected some manual test for the NL Postal Code

* Remove test cases depending on incomplete GenerateSuccesorOrPredecessor implementation
@mmaruniak
Copy link
Contributor

Resolved by #74

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants