eu_vat_rates_data 2026.9.29 → 2026.11.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5363e5ffcd769539fd284bd638433ad3ee4e260737b50622754959a1d7ed9436
4
- data.tar.gz: e42ef05b485a0b0f82e66afd32e476d4069e4b8a5c6bdf32c9d8ca83288b9ec1
3
+ metadata.gz: 6427d5974387318da878edbebc919e64150742cae2bba873f7fec249d41ed82b
4
+ data.tar.gz: 14a2c1073b64c03cce5ada4e589a6063da089601795cfd43d2149af71ee90bad
5
5
  SHA512:
6
- metadata.gz: 7c9bf70159730538743c1f8501570ae10e8c1fbdd6b6bba4cc7c5916bc560063e3e0260841571dbf0642f091d0004339ad019ad78b51f8db5310f01336e48602
7
- data.tar.gz: e3f0566055bfa9ca82f6e10e5ac2a6596b3bcdb833f081c611cb8856a9eb90aa45663685a329eb68d2dd610db83891ff5db9a8580558984f602c282e8633698a
6
+ metadata.gz: 87300dccf0e664190e800f5806f7f15ad954a0297e37a4675101d94e5515508784333cc1ebee0b196cb528c27ca27cf9363815d1e10f33904c69a36f97f9b72a
7
+ data.tar.gz: dcecd3ad1252370aa9f03a99c7915cc0ba39ca6c917db371da0e400b18183562ac439fb30c7a4fe6ae9592e4e541139bccbeff92b16e1bdccd9893f7387101a8
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2026-09-29",
2
+ "version": "2026-11-27",
3
3
  "source": "European Commission TEDB",
4
4
  "publisher": {
5
5
  "name": "vatnode.dev",
@@ -1,3 +1,3 @@
1
1
  module EuVatRatesData
2
- VERSION = "2026.9.29"
2
+ VERSION = "2026.11.28"
3
3
  end
@@ -71,7 +71,7 @@ module EuVatRatesData
71
71
 
72
72
  # Return true if vat_id matches the expected format for its country.
73
73
  # Input must include the country code prefix (e.g. "ATU12345678").
74
- # Returns false when the country has no standardised format or the ID does not match.
74
+ # Returns false for unknown country codes or when the ID does not match.
75
75
  # Note: Greece uses the "EL" prefix, not "GR".
76
76
  # @param vat_id [String] VAT number string including country code prefix
77
77
  # @return [Boolean]
@@ -82,7 +82,10 @@ module EuVatRatesData
82
82
  code = "GR" if code == "EL"
83
83
  rate = get_rate(code)
84
84
  return false unless rate && rate["pattern"]
85
- !!(vat_id.upcase =~ /\A#{rate["pattern"]}\z/)
85
+ # Most patterns carry the country prefix; the rest (NO, TR, UA, ...) describe
86
+ # the number without it and are tested against the part after the code.
87
+ subject = rate["pattern"].match?(/\A\^[A-Z]{2}/) ? vat_id : vat_id[2..]
88
+ !!(subject.upcase =~ /\A#{rate["pattern"]}\z/)
86
89
  end
87
90
 
88
91
  # Return the ISO 8601 date when EU data was last fetched from EC TEDB.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eu_vat_rates_data
3
3
  version: !ruby/object:Gem::Version
4
- version: 2026.9.29
4
+ version: 2026.11.28
5
5
  platform: ruby
6
6
  authors:
7
7
  - Iurii Rogulia
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-09-29 00:00:00.000000000 Z
11
+ date: 2026-11-28 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Daily-checked European VAT rates with standard and reduced rate types,
14
14
  offline access, local VAT metadata, and VAT number format validation.