From 352f3b5de7b3617def4692749b8bb722806bb430 Mon Sep 17 00:00:00 2001 From: Andrej Galuf Date: Tue, 22 Feb 2022 11:08:55 +0100 Subject: [PATCH] #4 - Update VAT Number validations from VIES list changes --- resources/vat.json | 17 +++++++++-------- tests/Unit/Repository/VatRepositoryTest.php | 13 +++++++------ 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/resources/vat.json b/resources/vat.json index eb5cabe..318c4d5 100644 --- a/resources/vat.json +++ b/resources/vat.json @@ -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}" @@ -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}" ], @@ -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}" @@ -87,5 +83,10 @@ ], "SK": [ "SK[0-9]{10}" + ], + "XI": [ + "XI[0-9]{9}", + "XI[0-9]{12}", + "XI[A-Z0-9]{5}" ] -} \ No newline at end of file +} diff --git a/tests/Unit/Repository/VatRepositoryTest.php b/tests/Unit/Repository/VatRepositoryTest.php index b1b7718..3a4abc6 100644 --- a/tests/Unit/Repository/VatRepositoryTest.php +++ b/tests/Unit/Repository/VatRepositoryTest.php @@ -94,6 +94,7 @@ public function provideViesSamples() { return [ ['AT', 'ATU99999999'], ['BE', 'BE0999999999'], + ['BE', 'BE1999999999'], ['BG', 'BG999999999'], ['BG', 'BG9999999999'], ['CY', 'CY99999999L'], @@ -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'], @@ -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'], ]; } -} \ No newline at end of file +}