Closed elboletaire closed 8 years ago
What I mean is... should I just validate the basic NIF? Or should I consider all the types? If I should consider all of them, should I add options to the basic personId method to test one or more types?
Seen the participation, I close the issue and I'll do a MR when I have this implemented.
I would like to implement the personId for Spain, but I've serious doubts about it.
Here in Spain we have at least 7 different personId with different calculations each one:
You can see all the Spanish NIF types on wikipedia: https://es.wikipedia.org/wiki/N%C3%BAmero_de_identificaci%C3%B3n_fiscal
That's referring to person ids (NIF), for companies we use other letters.
The question is... should I implement all of them? If so, I guess I should create a separate method for every different calculation, am I right?
I currently have this (ugly, would refactor obviously) method for testing NIFs on my CakePHP 1.3 apps:
Note that it does not cover all the cases... and it's very huge right now, but is a good sample of how much calculations do we have to ensure a personId is valid.