-
-
Notifications
You must be signed in to change notification settings - Fork 931
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
fix(finance): update iso-3166-1 country codes for IBAN/BIC #168
fix(finance): update iso-3166-1 country codes for IBAN/BIC #168
Conversation
✔️ Deploy Preview for vigilant-wescoff-04e480 ready! 🔨 Explore the source changes: c7beecf 🔍 Inspect the deploy log: https://app.netlify.com/sites/vigilant-wescoff-04e480/deploys/61e3f14654ea5200086836b3 😎 Browse the preview: https://deploy-preview-168--vigilant-wescoff-04e480.netlify.app |
To tun test you have to run |
c7beecf
to
5ebe630
Compare
Rebased on v6.0.0-alpha.5 and updated tests. |
I think it’s out of scope over here, but you might consider refactoring countries data (I suppose there are other places Faker uses these). You might also consider adding a dependencies for those, such as unicode-org/cldr-json, annexare/Countries or node-i18n-iso-countries. |
The ISO page seems to still be down. I will review it once it is back up again. |
@ST-DDT FYI ISO page seems to be back up |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
XK doesn't appear in the iso-list, but i found multiple references to it in some other online references, which I would consider good enough.
I also checked the code regarding the usage of the iso codes and it is only used to generate bic
s so it should be safe.
2aa6acf
to
272beba
Compare
Apologizes to Bulgaria and Kosovo.
272beba
to
771c70b
Compare
771c70b
to
1c81357
Compare
Rebased and updated tests as suggested by @Shinigami92 I had got a new failure in finance.spec.ts in a seed/bic test. I don’t know where those seeded values come from since they are hard-coded, but I had to change one of the BIC code ( |
Codecov Report
@@ Coverage Diff @@
## main #168 +/- ##
==========================================
- Coverage 99.33% 99.33% -0.01%
==========================================
Files 1920 1920
Lines 176483 176466 -17
Branches 905 905
==========================================
- Hits 175303 175286 -17
Misses 1124 1124
Partials 56 56
|
This happened because you deleted some entries from the definitions, so the indexes changed. The values are "fetched" from the definitions via |
@Shinigami92 You reassigned myself, is there anything I can do so far? 🙂 |
Nope, we just may have another workflow then you expect |
I had posted the issue
#1261
on the original repository, followed by a pull request (from this branch).To put it short: this simply update the list of ISO-3166-1 country codes [1] used for IBAN & BIC generations. As a matter of fact, some codes were nonexistent in the official specifications. Those have caused Faker.js to generate invalid IBAN and BIC codes (notably when checked against validator.js, for example).
FYI, as of today, I’m unable to run tests:Error: Cannot find module './lib'
[1] Both BIC (ISO-9362) and IBAN (ISO-13616) explicitly refers to ISO-3166-1.
It has also been suggested (here: #131) to use fake-numbers for IBAN generation. AFAIK, it uses a restricted list of country codes for IBAN generation (which I believe to be just fine). However, for BIC generation, fake-numbers uses a random string of 2 letters as a country code (which are unlikely to ever produce a valid BIC code IMHO).