fix(isVAT): align eight EU matchers with the official number structures - #2876
Open
rodrigobnogueira wants to merge 1 commit into
Open
fix(isVAT): align eight EU matchers with the official number structures#2876rodrigobnogueira wants to merge 1 commit into
rodrigobnogueira wants to merge 1 commit into
Conversation
BE, CY, LT, NL, RO, SE and SI accepted shapes no authority issues: a Belgian number starting with 2-8, a Cypriot number ending in a digit, a 10- or 11-digit Lithuanian code, a Dutch B00 sub-number, a Romanian code with a leading zero, a Swedish suffix other than 01, a Slovenian number starting with 0. IE is a bug fix rather than a tightening: the matcher rejected every number issued to a company since 2013, which carries a second letter other than W, and the legacy 1X23456L form that is still live in VIES. Test vectors are real registered entities confirmed against VIES; the placeholders that had to go were structurally impossible numbers.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2876 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 114 114
Lines 2599 2599
Branches 658 658
=========================================
Hits 2599 2599 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Aligns eight EU matchers with the number structures the national tax authorities and the Commission's VIES table publish, and fixes Ireland, which currently rejects every number issued to a company since 2013.
Each change still accepts every form the sources describe and rejects only shapes no authority issues. The new test vectors are real registered entities, each confirmed against VIES; the placeholder vectors that had to go were structurally impossible numbers (
CY123456789ends in a digit,LT12345678901is a length Lithuania never issues,SE…12has a suffix Skatteverket rules out).\d{10}[01]\d{9}\w{9}\d{8}[A-Z]\walso admitted_and letters in the digit positions.\d{7}\w(W)?\d{7}[A-W][A-Z]?or\d[A-Z+*]\d{5}[A-W]W(IE3206488LH, Stripe) and the legacy1X23456Lform is still live in VIES (IE8F52100V, ESB); both are rejected today. The check letter is modulus 23, so onlyA–W.\d{9,12}(\d{7}|\d{10})1\d\d{9}B\d{2}\d{9}B(0[1-9]|[1-9]\d)B01–B99;B00is never issued.\d{2,10}[1-9]\d{1,9}RO19is valid,RO019is not.\d{12}\d{10}01\d{8}[1-9]\d{7}FR was checked and left as is: the official structure defines both key characters as "a letter or a digit".
References:
Validation:
npm test— 323 passing.Checklist