Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: #ensure_valid_syntax on tax ids (#1)
### Why? As a user of TaxIds I want to make as few government database lookups as possible. By making sure that the TaxId initializer only creates instances that adhere to the specific TaxId type syntaxes we can avoid any unnecessary lookups. ### What changed? - Added the `tax_country_code` field to the TaxId struct. This field is populated with the two-letter code at the start of the tax id value. IE: `"SE"` in `"SE123456789101"`. This was added due to cases where the TaxId value uses another two-letter iso code than the country. IE: `"GR"` & `"EL"` or `"GB"` and `"XI"`. - Depending on the tax id value provided, TaxId initializer will route tp different `TaxIdTypes`. IE: `"SE123456789101"` will resolve to the `EUVat` while `"GBHA123"` will resolve to `GBVat`. - Added regexes for EUVats & GBVat
- Loading branch information