Functional Weave
Code in Rust

retail.oss-vat@1.0.1

vectors.json

10,796 bytes · view raw

[
  {"name": "over the threshold: the customer's rate through OSS", "args": [{"minor": 10000, "currency": "EUR"}, "DE", "FR", {"minor": 5000000, "currency": "EUR"}, {"minor": 5000000, "currency": "EUR"}, false, "2026-09-01"], "expect": {"taxCountry": "FR", "scheme": "oss", "basisPoints": 2000, "thresholdExceeded": true, "net": {"minor": 10000, "currency": "EUR"}, "vat": {"minor": 2000, "currency": "EUR"}, "gross": {"minor": 12000, "currency": "EUR"}}},
  {"name": "under the threshold: the seller's own rate", "args": [{"minor": 10000, "currency": "EUR"}, "DE", "FR", {"minor": 500000, "currency": "EUR"}, {"minor": 800000, "currency": "EUR"}, false, "2026-09-01"], "expect": {"taxCountry": "DE", "scheme": "origin", "basisPoints": 1900, "thresholdExceeded": false, "net": {"minor": 10000, "currency": "EUR"}, "vat": {"minor": 1900, "currency": "EUR"}, "gross": {"minor": 11900, "currency": "EUR"}}},
  {"name": "exactly EUR 10,000 this year does not exceed it", "args": [{"minor": 10000, "currency": "EUR"}, "DE", "FR", {"minor": 500000, "currency": "EUR"}, {"minor": 1000000, "currency": "EUR"}, false, "2026-09-01"], "expect": {"taxCountry": "DE", "scheme": "origin", "basisPoints": 1900, "thresholdExceeded": false, "net": {"minor": 10000, "currency": "EUR"}, "vat": {"minor": 1900, "currency": "EUR"}, "gross": {"minor": 11900, "currency": "EUR"}}},
  {"name": "one cent over: this supply is already taxed at destination", "args": [{"minor": 10000, "currency": "EUR"}, "DE", "FR", {"minor": 500000, "currency": "EUR"}, {"minor": 1000001, "currency": "EUR"}, false, "2026-09-01"], "expect": {"taxCountry": "FR", "scheme": "oss", "basisPoints": 2000, "thresholdExceeded": true, "net": {"minor": 10000, "currency": "EUR"}, "vat": {"minor": 2000, "currency": "EUR"}, "gross": {"minor": 12000, "currency": "EUR"}}},
  {"name": "exceeded last year only: still destination all this year", "args": [{"minor": 10000, "currency": "EUR"}, "DE", "FR", {"minor": 1200000, "currency": "EUR"}, {"minor": 0, "currency": "EUR"}, false, "2026-09-01"], "expect": {"taxCountry": "FR", "scheme": "oss", "basisPoints": 2000, "thresholdExceeded": true, "net": {"minor": 10000, "currency": "EUR"}, "vat": {"minor": 2000, "currency": "EUR"}, "gross": {"minor": 12000, "currency": "EUR"}}},
  {"name": "opting in taxes at destination below the threshold", "args": [{"minor": 10000, "currency": "EUR"}, "DE", "FR", {"minor": 500000, "currency": "EUR"}, {"minor": 500000, "currency": "EUR"}, true, "2026-09-01"], "expect": {"taxCountry": "FR", "scheme": "oss", "basisPoints": 2000, "thresholdExceeded": false, "net": {"minor": 10000, "currency": "EUR"}, "vat": {"minor": 2000, "currency": "EUR"}, "gross": {"minor": 12000, "currency": "EUR"}}},
  {"name": "same country is a domestic sale", "args": [{"minor": 10000, "currency": "EUR"}, "DE", "DE", {"minor": 5000000, "currency": "EUR"}, {"minor": 5000000, "currency": "EUR"}, false, "2026-09-01"], "expect": {"taxCountry": "DE", "scheme": "domestic", "basisPoints": 1900, "thresholdExceeded": true, "net": {"minor": 10000, "currency": "EUR"}, "vat": {"minor": 1900, "currency": "EUR"}, "gross": {"minor": 11900, "currency": "EUR"}}},
  {"name": "a seller outside the EU has no threshold", "args": [{"minor": 10000, "currency": "EUR"}, "GB", "IE", {"minor": 0, "currency": "EUR"}, {"minor": 0, "currency": "EUR"}, false, "2026-09-01"], "expect": {"taxCountry": "IE", "scheme": "oss", "basisPoints": 2300, "thresholdExceeded": false, "net": {"minor": 10000, "currency": "EUR"}, "vat": {"minor": 2300, "currency": "EUR"}, "gross": {"minor": 12300, "currency": "EUR"}}},
  {"name": "Estonia on the last day at 22%", "args": [{"minor": 10000, "currency": "EUR"}, "DE", "EE", {"minor": 5000000, "currency": "EUR"}, {"minor": 5000000, "currency": "EUR"}, false, "2025-06-30"], "expect": {"taxCountry": "EE", "scheme": "oss", "basisPoints": 2200, "thresholdExceeded": true, "net": {"minor": 10000, "currency": "EUR"}, "vat": {"minor": 2200, "currency": "EUR"}, "gross": {"minor": 12200, "currency": "EUR"}}},
  {"name": "Estonia from 1 July 2025 at 24%", "args": [{"minor": 10000, "currency": "EUR"}, "DE", "EE", {"minor": 5000000, "currency": "EUR"}, {"minor": 5000000, "currency": "EUR"}, false, "2025-07-01"], "expect": {"taxCountry": "EE", "scheme": "oss", "basisPoints": 2400, "thresholdExceeded": true, "net": {"minor": 10000, "currency": "EUR"}, "vat": {"minor": 2400, "currency": "EUR"}, "gross": {"minor": 12400, "currency": "EUR"}}},
  {"name": "Finland's 25.5% rounds half up to the cent", "args": [{"minor": 9999, "currency": "EUR"}, "DE", "FI", {"minor": 5000000, "currency": "EUR"}, {"minor": 5000000, "currency": "EUR"}, false, "2026-09-01"], "expect": {"taxCountry": "FI", "scheme": "oss", "basisPoints": 2550, "thresholdExceeded": true, "net": {"minor": 9999, "currency": "EUR"}, "vat": {"minor": 2550, "currency": "EUR"}, "gross": {"minor": 12549, "currency": "EUR"}}},
  {"name": "Luxembourg's temporary 16% in 2023", "args": [{"minor": 10000, "currency": "EUR"}, "DE", "LU", {"minor": 5000000, "currency": "EUR"}, {"minor": 5000000, "currency": "EUR"}, false, "2023-06-15"], "expect": {"taxCountry": "LU", "scheme": "oss", "basisPoints": 1600, "thresholdExceeded": true, "net": {"minor": 10000, "currency": "EUR"}, "vat": {"minor": 1600, "currency": "EUR"}, "gross": {"minor": 11600, "currency": "EUR"}}},
  {"name": "Slovakia before and after 1 January 2025: before", "args": [{"minor": 10000, "currency": "EUR"}, "AT", "SK", {"minor": 5000000, "currency": "EUR"}, {"minor": 5000000, "currency": "EUR"}, false, "2024-12-31"], "expect": {"taxCountry": "SK", "scheme": "oss", "basisPoints": 2000, "thresholdExceeded": true, "net": {"minor": 10000, "currency": "EUR"}, "vat": {"minor": 2000, "currency": "EUR"}, "gross": {"minor": 12000, "currency": "EUR"}}},
  {"name": "Romania from 1 August 2025", "args": [{"minor": 10000, "currency": "EUR"}, "AT", "RO", {"minor": 5000000, "currency": "EUR"}, {"minor": 5000000, "currency": "EUR"}, false, "2025-08-01"], "expect": {"taxCountry": "RO", "scheme": "oss", "basisPoints": 2100, "thresholdExceeded": true, "net": {"minor": 10000, "currency": "EUR"}, "vat": {"minor": 2100, "currency": "EUR"}, "gross": {"minor": 12100, "currency": "EUR"}}},
  {"name": "EL is accepted for Greece and reported as GR", "args": [{"minor": 10000, "currency": "EUR"}, "IT", "EL", {"minor": 5000000, "currency": "EUR"}, {"minor": 5000000, "currency": "EUR"}, false, "2026-09-01"], "expect": {"taxCountry": "GR", "scheme": "oss", "basisPoints": 2400, "thresholdExceeded": true, "net": {"minor": 10000, "currency": "EUR"}, "vat": {"minor": 2400, "currency": "EUR"}, "gross": {"minor": 12400, "currency": "EUR"}}},
  {"name": "the net may be in another currency; the thresholds are in euros", "args": [{"minor": 10000, "currency": "PLN"}, "PL", "CZ", {"minor": 5000000, "currency": "EUR"}, {"minor": 5000000, "currency": "EUR"}, false, "2026-09-01"], "expect": {"taxCountry": "CZ", "scheme": "oss", "basisPoints": 2100, "thresholdExceeded": true, "net": {"minor": 10000, "currency": "PLN"}, "vat": {"minor": 2100, "currency": "PLN"}, "gross": {"minor": 12100, "currency": "PLN"}}},
  {"name": "a credit note: a negative net gives negative VAT", "args": [{"minor": -10000, "currency": "EUR"}, "DE", "FR", {"minor": 5000000, "currency": "EUR"}, {"minor": 5000000, "currency": "EUR"}, false, "2026-09-01"], "expect": {"taxCountry": "FR", "scheme": "oss", "basisPoints": 2000, "thresholdExceeded": true, "net": {"minor": -10000, "currency": "EUR"}, "vat": {"minor": -2000, "currency": "EUR"}, "gross": {"minor": -12000, "currency": "EUR"}}},
  {"name": "Hungary's 27%, the highest standard rate", "args": [{"minor": 1000, "currency": "EUR"}, "DE", "HU", {"minor": 5000000, "currency": "EUR"}, {"minor": 5000000, "currency": "EUR"}, false, "2026-09-01"], "expect": {"taxCountry": "HU", "scheme": "oss", "basisPoints": 2700, "thresholdExceeded": true, "net": {"minor": 1000, "currency": "EUR"}, "vat": {"minor": 270, "currency": "EUR"}, "gross": {"minor": 1270, "currency": "EUR"}}},
  {"name": "a customer outside the EU is an error", "args": [{"minor": 10000, "currency": "EUR"}, "DE", "US", {"minor": 5000000, "currency": "EUR"}, {"minor": 5000000, "currency": "EUR"}, false, "2026-09-01"], "expectError": "customer country \"US\" is not an EU member state"},
  {"name": "the UK is outside the EU", "args": [{"minor": 10000, "currency": "EUR"}, "DE", "GB", {"minor": 5000000, "currency": "EUR"}, {"minor": 5000000, "currency": "EUR"}, false, "2026-09-01"], "expectError": "customer country \"GB\" is not an EU member state"},
  {"name": "a date before OSS began is an error", "args": [{"minor": 10000, "currency": "EUR"}, "DE", "FR", {"minor": 5000000, "currency": "EUR"}, {"minor": 5000000, "currency": "EUR"}, false, "2021-06-30"], "expectError": "no OSS rule"},
  {"name": "threshold totals must be in euros", "args": [{"minor": 10000, "currency": "EUR"}, "DE", "FR", {"minor": 500000, "currency": "GBP"}, {"minor": 500000, "currency": "EUR"}, false, "2026-09-01"], "expectError": "euSalesPreviousYear must be in EUR, received GBP"},
  {"name": "a country name is not a code", "args": [{"minor": 10000, "currency": "EUR"}, "Germany", "FR", {"minor": 5000000, "currency": "EUR"}, {"minor": 5000000, "currency": "EUR"}, false, "2026-09-01"], "expectError": "sellerCountry must be an ISO 3166-1 alpha-2 code"},
  {"name": "a malformed date is an error", "args": [{"minor": 10000, "currency": "EUR"}, "DE", "FR", {"minor": 5000000, "currency": "EUR"}, {"minor": 5000000, "currency": "EUR"}, false, "01/09/2026"], "expectError": "onDate must be an ISO date (YYYY-MM-DD)"},
  {"name": "a trailing newline is not part of an ISO date (onDate)", "args": [{"minor": 10000, "currency": "EUR"}, "DE", "FR", {"minor": 5000000, "currency": "EUR"}, {"minor": 5000000, "currency": "EUR"}, false, "2026-09-16\n"], "expectError": "onDate must be an ISO date (YYYY-MM-DD)"},
  {"name": "non-ASCII digits are not an ISO date (onDate)", "args": [{"minor": 10000, "currency": "EUR"}, "DE", "FR", {"minor": 5000000, "currency": "EUR"}, {"minor": 5000000, "currency": "EUR"}, false, "٢٠٢٦-09-16"], "expectError": "onDate must be an ISO date (YYYY-MM-DD)"},
  {"name": "a trailing newline is not part of a country code", "args": [{"minor": 10000, "currency": "EUR"}, "DE\n", "FR", {"minor": 5000000, "currency": "EUR"}, {"minor": 5000000, "currency": "EUR"}, false, "2026-09-01"], "expectError": "sellerCountry must be an ISO 3166-1 alpha-2 code"},
  {"name": "a trailing newline is not part of a customer country code", "args": [{"minor": 10000, "currency": "EUR"}, "DE", "FR\n", {"minor": 5000000, "currency": "EUR"}, {"minor": 5000000, "currency": "EUR"}, false, "2026-09-01"], "expectError": "customerCountry must be an ISO 3166-1 alpha-2 code"}
]