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

Add subdivisions to Colombia #89

Closed

Conversation

yaazkal
Copy link
Contributor

@yaazkal yaazkal commented Aug 28, 2017

This will add Administrative areas to Colombia (Departments) and also postal code validation and a proper format for the country as the information is not still available at google libaddressinput. see google/libaddressinput#135

@yaazkal
Copy link
Contributor Author

yaazkal commented Aug 29, 2017

Please also take in mind #88 and to also update src/AddressFormat/AddressFormatRepository.php as it seems was not updated when #74 was done, causing the GU format still has no effect on master.
As I was not sure if I need to include it here, I just mention it, because I don't know if you just do that when a release is going to happen. Let me know if I should commit that file too.

@yaazkal
Copy link
Contributor Author

yaazkal commented Dec 21, 2017

@bojanz I see the test failed but because of travis config.

Please let me know if I can help in other thing or if I need to modify this code in order to get the PR accepted.

@bojanz
Copy link
Contributor

bojanz commented May 11, 2018

@yaazkal Sorry for the long delay in looking at this. I would like to land the PR soon.

I've reviewed the subdivision list and it looks good. My only question is about the address format override. It currently differs from the shipped one in two ways:

  • Locality is made required
  • The postal code pattern (\d{6}) was removed

Are both of these changes intentional? And why? Once I know, I'll rebase and merge the PR.

@yaazkal
Copy link
Contributor Author

yaazkal commented May 11, 2018

Hi @bojanz thanks for taking a look.

Locality in this context is required as it refers to the city of destitation. Every city in Colombia has it's own address numbers and they are not unique, son given an address is a must to know the city even if they are in the same administrative area (State/Province, just that in Colombia they are called Departments). I can't find legal documentation that says it is required but I can tell you that there is no courier or postal agency that will accept a package without puting the name of the city.

The postal code pattern is pretty generic using \d{6}, so you can put any number on it. Actually the postal code in Colombia is: two first digits are for administrative areas, next two digits are for regional zones and last two digits for localities zones.

To make just a generic validation given the administrative area, I put those prefixes for each one based on the postal code: https://es.wikipedia.org/wiki/Anexo:Códigos_postales_de_Colombia

This is still la pretty generic solution but at least it validates the administrative area. I can also put those city names and codes if needed to also validate the localities but I did not push it since I thing is just too specific, but maybe it can be another topic for a new PR.

@bojanz
Copy link
Contributor

bojanz commented May 14, 2018

Thanks for the clarification. Finished and committed in a71081e.

@bojanz bojanz closed this May 14, 2018
@yaazkal
Copy link
Contributor Author

yaazkal commented May 14, 2018

Great, thanks so much @bojanz

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

Successfully merging this pull request may close these issues.

2 participants