[
{ "name": "VAT inside 120 pounds is 20, not 24", "args": [{ "minor": 12000, "currency": "GBP" }, "GB", "STANDARD", "2026-09-16"], "expect": { "net": { "minor": 10000, "currency": "GBP" }, "tax": { "minor": 2000, "currency": "GBP" }, "gross": { "minor": 12000, "currency": "GBP" }, "basisPoints": 2000 } },
{ "name": "round trips with add-vat", "args": [{ "minor": 239, "currency": "GBP" }, "GB", "STANDARD", "2026-09-16"], "expect": { "net": { "minor": 199, "currency": "GBP" }, "tax": { "minor": 40, "currency": "GBP" }, "gross": { "minor": 239, "currency": "GBP" }, "basisPoints": 2000 } },
{ "name": "a 1 pound gross price", "args": [{ "minor": 100, "currency": "GBP" }, "GB", "STANDARD", "2026-09-16"], "expect": { "net": { "minor": 83, "currency": "GBP" }, "tax": { "minor": 17, "currency": "GBP" }, "gross": { "minor": 100, "currency": "GBP" }, "basisPoints": 2000 } },
{ "name": "zero rated gross is all net", "args": [{ "minor": 10000, "currency": "GBP" }, "GB", "ZERO", "2026-09-16"], "expect": { "net": { "minor": 10000, "currency": "GBP" }, "tax": { "minor": 0, "currency": "GBP" }, "gross": { "minor": 10000, "currency": "GBP" }, "basisPoints": 0 } },
{ "name": "reduced rate gross", "args": [{ "minor": 10500, "currency": "GBP" }, "GB", "REDUCED", "2026-09-16"], "expect": { "net": { "minor": 10000, "currency": "GBP" }, "tax": { "minor": 500, "currency": "GBP" }, "gross": { "minor": 10500, "currency": "GBP" }, "basisPoints": 500 } },
{ "name": "a 2009 gross price uses the 2009 rate", "args": [{ "minor": 11500, "currency": "GBP" }, "GB", "STANDARD", "2009-06-01"], "expect": { "net": { "minor": 10000, "currency": "GBP" }, "tax": { "minor": 1500, "currency": "GBP" }, "gross": { "minor": 11500, "currency": "GBP" }, "basisPoints": 1500 } },
{ "name": "a refund of a gross price", "args": [{ "minor": -12000, "currency": "GBP" }, "GB", "STANDARD", "2026-09-16"], "expect": { "net": { "minor": -10000, "currency": "GBP" }, "tax": { "minor": -2000, "currency": "GBP" }, "gross": { "minor": -12000, "currency": "GBP" }, "basisPoints": 2000 } },
{ "name": "a tie in the net rounds half up, so 9p holds 1p of VAT, not the 2p that 20% of the net suggests", "args": [{ "minor": 9, "currency": "GBP" }, "GB", "STANDARD", "2026-09-16"], "expect": { "net": { "minor": 8, "currency": "GBP" }, "tax": { "minor": 1, "currency": "GBP" }, "gross": { "minor": 9, "currency": "GBP" }, "basisPoints": 2000 } },
{ "name": "a refund's tie rounds away from zero the same way", "args": [{ "minor": -9, "currency": "GBP" }, "GB", "STANDARD", "2026-09-16"], "expect": { "net": { "minor": -8, "currency": "GBP" }, "tax": { "minor": -1, "currency": "GBP" }, "gross": { "minor": -9, "currency": "GBP" }, "basisPoints": 2000 } },
{ "name": "a penny holds no VAT", "args": [{ "minor": 1, "currency": "GBP" }, "GB", "STANDARD", "2026-09-16"], "expect": { "net": { "minor": 1, "currency": "GBP" }, "tax": { "minor": 0, "currency": "GBP" }, "gross": { "minor": 1, "currency": "GBP" }, "basisPoints": 2000 } },
{ "name": "zero gross is zero everything", "args": [{ "minor": 0, "currency": "GBP" }, "GB", "STANDARD", "2026-09-16"], "expect": { "net": { "minor": 0, "currency": "GBP" }, "tax": { "minor": 0, "currency": "GBP" }, "gross": { "minor": 0, "currency": "GBP" }, "basisPoints": 2000 } },
{ "name": "exempt supplies carry no VAT", "args": [{ "minor": 10000, "currency": "GBP" }, "GB", "EXEMPT", "2026-09-16"], "expect": { "net": { "minor": 10000, "currency": "GBP" }, "tax": { "minor": 0, "currency": "GBP" }, "gross": { "minor": 10000, "currency": "GBP" }, "basisPoints": 0 } },
{ "name": "a 2010 gross price uses the 17.5% rate", "args": [{ "minor": 11750, "currency": "GBP" }, "GB", "STANDARD", "2010-06-01"], "expect": { "net": { "minor": 10000, "currency": "GBP" }, "tax": { "minor": 1750, "currency": "GBP" }, "gross": { "minor": 11750, "currency": "GBP" }, "basisPoints": 1750 } },
{ "name": "an Irish gross price uses the Irish 23% rate", "args": [{ "minor": 12300, "currency": "EUR" }, "IE", "STANDARD", "2026-09-16"], "expect": { "net": { "minor": 10000, "currency": "EUR" }, "tax": { "minor": 2300, "currency": "EUR" }, "gross": { "minor": 12300, "currency": "EUR" }, "basisPoints": 2300 } },
{ "name": "an Irish reduced rate that does not divide evenly", "args": [{ "minor": 1000, "currency": "EUR" }, "IE", "REDUCED", "2026-09-16"], "expect": { "net": { "minor": 881, "currency": "EUR" }, "tax": { "minor": 119, "currency": "EUR" }, "gross": { "minor": 1000, "currency": "EUR" }, "basisPoints": 1350 } },
{ "name": "a large gross stays exact", "args": [{ "minor": 120000000000, "currency": "GBP" }, "GB", "STANDARD", "2026-09-16"], "expect": { "net": { "minor": 100000000000, "currency": "GBP" }, "tax": { "minor": 20000000000, "currency": "GBP" }, "gross": { "minor": 120000000000, "currency": "GBP" }, "basisPoints": 2000 } },
{ "name": "a jurisdiction with no rules is an error", "args": [{ "minor": 12000, "currency": "GBP" }, "XX", "STANDARD", "2026-09-16"], "expectError": "no VAT rule" },
{ "name": "a category with no rules is an error", "args": [{ "minor": 12000, "currency": "GBP" }, "GB", "LUXURY", "2026-09-16"], "expectError": "no VAT rule" },
{ "name": "a date that is not ISO is an error", "args": [{ "minor": 12000, "currency": "GBP" }, "GB", "STANDARD", "16/09/2026"], "expectError": "ISO date" },
{ "name": "an invalid currency is an error", "args": [{ "minor": 12000, "currency": "gbp" }, "GB", "STANDARD", "2026-09-16"], "expectError": "ISO 4217" }
]