Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## [Unreleased]

Features:
- Add `TinValid::COUNTRY_CODES` to get available country codes.

Fixes:
- Fix Bulgaria to accept TINs starting with `10` instead of `00` 🇧🇬
- Fix Finland checks for tins ending in `P` 🇫🇮
Expand All @@ -16,7 +19,7 @@ Fixes:

Features:
- Add generic `TinValid::Tin.new(country_code: "…", tin: "…").valid?`
- Add `#siren?` and `#siret?` on `TinValid::FranceTin`
- Add `#siren?` and `#siret?` on `TinValid::FranceTin` 🇫🇷

Fixes:
- Accept SIRET for France 🇫🇷
Expand Down
33 changes: 32 additions & 1 deletion lib/tin_valid.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,35 @@
require_relative "tin_valid/sweden_tin"
require_relative "tin_valid/united_kingdom_tin"

module TinValid; end
module TinValid
COUNTRY_CODES = %w[
at
be
bg
cy
cz
de
dk
ee
es
fi
fr
gb
gr
hr
hu
ie
it
lt
lu
lv
mt
nl
pl
pt
ro
se
si
sk
].freeze
end