Skip to content

Commit

Permalink
Merge pull request #5 from agaluf/4-update_vat_number_validations
Browse files Browse the repository at this point in the history
#4 - Update VAT Number validations from VIES list changes
  • Loading branch information
agaluf authored Feb 22, 2022
2 parents 33e8683 + 352f3b5 commit 5c27b50
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
17 changes: 9 additions & 8 deletions resources/vat.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"ATU[A-Z0-9]{8}"
],
"BE": [
"BE0[0-9]{9}"
"BE0[0-9]{9}",
"BE1[0-9]{9}"
],
"BG": [
"BG[0-9]{9,10}"
Expand Down Expand Up @@ -34,11 +35,6 @@
"FR": [
"FR[A-Z0-9]{2}[0-9]{9}"
],
"GB" : [
"GB[0-9]{9}",
"GB[0-9]{12}",
"GB[A-Z0-9]{5}"
],
"GR": [
"EL[0-9]{9}"
],
Expand Down Expand Up @@ -68,7 +64,7 @@
"MT[0-9]{8}"
],
"NL": [
"NL[A-Z0-9]{9}B[A-Z0-9]{2}"
"NL[A-Z0-9]{12}"
],
"PL": [
"PL[0-9]{10}"
Expand All @@ -87,5 +83,10 @@
],
"SK": [
"SK[0-9]{10}"
],
"XI": [
"XI[0-9]{9}",
"XI[0-9]{12}",
"XI[A-Z0-9]{5}"
]
}
}
13 changes: 7 additions & 6 deletions tests/Unit/Repository/VatRepositoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ public function provideViesSamples() {
return [
['AT', 'ATU99999999'],
['BE', 'BE0999999999'],
['BE', 'BE1999999999'],
['BG', 'BG999999999'],
['BG', 'BG9999999999'],
['CY', 'CY99999999L'],
Expand All @@ -110,10 +111,6 @@ public function provideViesSamples() {
['FI', 'FI99999999'],
['FR', 'FRXX999999999'],
['FR', 'FR99999999999'],
['GB', 'GB999999999'],
['GB', 'GB999999999999'],
['GB', 'GBGD999'],
['GB', 'GBHA999'],
['HR', 'HR99999999999'],
['HU', 'HU99999999'],
['IE', 'IE9S99999L'],
Expand All @@ -124,15 +121,19 @@ public function provideViesSamples() {
['LU', 'LU99999999'],
['LV', 'LV99999999999'],
['MT', 'MT99999999'],
['NL', 'NL999999999B99'],
['NL', 'NLSSSSSSSSSSSS'],
['PL', 'PL9999999999'],
['PT', 'PT999999999'],
['RO', 'RO999999999'],
['SE', 'SE999999999999'],
['SI', 'SI99999999'],
['SK', 'SK9999999999'],
['XI', 'XI999999999'],
['XI', 'XI999999999999'],
['XI', 'XIGD999'],
['XI', 'XIHA999'],
];
}


}
}

0 comments on commit 5c27b50

Please sign in to comment.