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

New Feature Faker::DNI or Faker::NIE #872

Closed
jmolina4 opened this issue Apr 6, 2017 · 4 comments
Closed

New Feature Faker::DNI or Faker::NIE #872

jmolina4 opened this issue Apr 6, 2017 · 4 comments

Comments

@jmolina4
Copy link

jmolina4 commented Apr 6, 2017

I'd like to be able to generate random dni and nies like this http://generadordni.es/

@PuZZleDucK
Copy link
Contributor

What kind of numbers are they, bank account numbers? company identifiers? other?

@jmolina4
Copy link
Author

jmolina4 commented Feb 6, 2018

@PuZZleDucK citizen identifier, is the number you use to identify yourself in an specific country. In Spain is DNI when you are born inside the country, and the NIE when you come from another country. Maybe it is an optional feature that depends on the country...yet I think it can be useful.

https://en.wikipedia.org/wiki/National_identification_number

@PuZZleDucK
Copy link
Contributor

Ahh... it seems faker has a Faker::IDNumber module where this could go, but it's not documented yet.

I also think we should follow the example in company.rb where we use a longer name like "spanish_organisation_number"... or in our case "spanish_citizen_number" and "spanish_foreign_citizen_number"

PuZZleDucK added a commit to PuZZleDucK/faker that referenced this issue Feb 9, 2018
vbrazo pushed a commit that referenced this issue May 15, 2018
* update rake

* add id_number docs

* add tests for ssn

* add failing tests for spanish IDs

* add spanish citizen ids for issue #872

* cleanup comments

* give spanish_citizen_number correct checksum

* add validation checksum to Spanish NIE

* convert asserts into asert_equals

* replacing string concatenation with interpolation

* Minor changes

* Run rubocop and fix lint
@vbrazo
Copy link
Member

vbrazo commented Sep 18, 2018

Closing this issue, because it looks like we've already worked on it.

@vbrazo vbrazo closed this as completed Sep 18, 2018
davidmorton0 pushed a commit to davidmorton0/faker that referenced this issue Jul 12, 2021
* update rake

* add id_number docs

* add tests for ssn

* add failing tests for spanish IDs

* add spanish citizen ids for issue faker-ruby#872

* cleanup comments

* give spanish_citizen_number correct checksum

* add validation checksum to Spanish NIE

* convert asserts into asert_equals

* replacing string concatenation with interpolation

* Minor changes

* Run rubocop and fix lint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants