[
{"name": "a consumer basket: 3 for 2 on wine, a 5.00 coupon shared by line, VAT extracted per line, taxed delivery", "args": [[{"sku": "TEA", "unitPrice": {"minor": 250, "currency": "GBP"}, "quantity": 2, "taxCategory": "ZERO"}, {"sku": "MUG", "unitPrice": {"minor": 800, "currency": "GBP"}, "quantity": 1, "taxCategory": "STANDARD"}, {"sku": "WINE", "unitPrice": {"minor": 900, "currency": "GBP"}, "quantity": 3, "taxCategory": "STANDARD"}], [{"id": "wine-3for2", "kind": "free-items", "skus": ["WINE"], "groupSize": 3, "freeItems": 1, "basisPoints": 0, "amount": null}], {"minor": 500, "currency": "GBP"}, {"minor": 395, "currency": "GBP"}, "STANDARD", true, "GB", "2026-09-15"], "expect": {"lines": [{"sku": "TEA", "quantity": 2, "gross": {"minor": 500, "currency": "GBP"}, "promotionDiscount": {"minor": 0, "currency": "GBP"}, "basketDiscount": {"minor": 81, "currency": "GBP"}, "net": {"minor": 419, "currency": "GBP"}, "tax": {"minor": 0, "currency": "GBP"}, "total": {"minor": 419, "currency": "GBP"}}, {"sku": "MUG", "quantity": 1, "gross": {"minor": 800, "currency": "GBP"}, "promotionDiscount": {"minor": 0, "currency": "GBP"}, "basketDiscount": {"minor": 129, "currency": "GBP"}, "net": {"minor": 559, "currency": "GBP"}, "tax": {"minor": 112, "currency": "GBP"}, "total": {"minor": 671, "currency": "GBP"}}, {"sku": "WINE", "quantity": 3, "gross": {"minor": 2700, "currency": "GBP"}, "promotionDiscount": {"minor": 900, "currency": "GBP"}, "basketDiscount": {"minor": 290, "currency": "GBP"}, "net": {"minor": 1258, "currency": "GBP"}, "tax": {"minor": 252, "currency": "GBP"}, "total": {"minor": 1510, "currency": "GBP"}}], "promotions": [{"id": "wine-3for2", "groups": 1, "discount": {"minor": 900, "currency": "GBP"}}], "delivery": {"net": {"minor": 329, "currency": "GBP"}, "tax": {"minor": 66, "currency": "GBP"}, "gross": {"minor": 395, "currency": "GBP"}, "basisPoints": 2000}, "vatBreakdown": [{"basisPoints": 0, "net": {"minor": 419, "currency": "GBP"}, "tax": {"minor": 0, "currency": "GBP"}}, {"basisPoints": 2000, "net": {"minor": 2146, "currency": "GBP"}, "tax": {"minor": 430, "currency": "GBP"}}], "subtotal": {"minor": 4000, "currency": "GBP"}, "promotionDiscount": {"minor": 900, "currency": "GBP"}, "basketDiscount": {"minor": 500, "currency": "GBP"}, "net": {"minor": 2565, "currency": "GBP"}, "tax": {"minor": 430, "currency": "GBP"}, "total": {"minor": 2995, "currency": "GBP"}}},
{"name": "a trade basket: VAT added on top, zero-rated delivery of nothing left out of the summary", "args": [[{"sku": "SERVICE", "unitPrice": {"minor": 10000, "currency": "GBP"}, "quantity": 1, "taxCategory": "STANDARD"}, {"sku": "BOOK", "unitPrice": {"minor": 1250, "currency": "GBP"}, "quantity": 2, "taxCategory": "ZERO"}], [], {"minor": 0, "currency": "GBP"}, {"minor": 0, "currency": "GBP"}, "ZERO", false, "GB", "2026-09-15"], "expect": {"lines": [{"sku": "SERVICE", "quantity": 1, "gross": {"minor": 10000, "currency": "GBP"}, "promotionDiscount": {"minor": 0, "currency": "GBP"}, "basketDiscount": {"minor": 0, "currency": "GBP"}, "net": {"minor": 10000, "currency": "GBP"}, "tax": {"minor": 2000, "currency": "GBP"}, "total": {"minor": 12000, "currency": "GBP"}}, {"sku": "BOOK", "quantity": 2, "gross": {"minor": 2500, "currency": "GBP"}, "promotionDiscount": {"minor": 0, "currency": "GBP"}, "basketDiscount": {"minor": 0, "currency": "GBP"}, "net": {"minor": 2500, "currency": "GBP"}, "tax": {"minor": 0, "currency": "GBP"}, "total": {"minor": 2500, "currency": "GBP"}}], "promotions": [], "delivery": {"net": {"minor": 0, "currency": "GBP"}, "tax": {"minor": 0, "currency": "GBP"}, "gross": {"minor": 0, "currency": "GBP"}, "basisPoints": 0}, "vatBreakdown": [{"basisPoints": 0, "net": {"minor": 2500, "currency": "GBP"}, "tax": {"minor": 0, "currency": "GBP"}}, {"basisPoints": 2000, "net": {"minor": 10000, "currency": "GBP"}, "tax": {"minor": 2000, "currency": "GBP"}}], "subtotal": {"minor": 12500, "currency": "GBP"}, "promotionDiscount": {"minor": 0, "currency": "GBP"}, "basketDiscount": {"minor": 0, "currency": "GBP"}, "net": {"minor": 12500, "currency": "GBP"}, "tax": {"minor": 2000, "currency": "GBP"}, "total": {"minor": 14500, "currency": "GBP"}}},
{"name": "VAT is on the discounted price: 10.00 less 1.00 plus VAT is 10.80, not 11.00", "args": [[{"sku": "A", "unitPrice": {"minor": 1000, "currency": "GBP"}, "quantity": 1, "taxCategory": "STANDARD"}], [], {"minor": 100, "currency": "GBP"}, {"minor": 0, "currency": "GBP"}, "STANDARD", false, "GB", "2026-09-15"], "expect": {"lines": [{"sku": "A", "quantity": 1, "gross": {"minor": 1000, "currency": "GBP"}, "promotionDiscount": {"minor": 0, "currency": "GBP"}, "basketDiscount": {"minor": 100, "currency": "GBP"}, "net": {"minor": 900, "currency": "GBP"}, "tax": {"minor": 180, "currency": "GBP"}, "total": {"minor": 1080, "currency": "GBP"}}], "promotions": [], "delivery": {"net": {"minor": 0, "currency": "GBP"}, "tax": {"minor": 0, "currency": "GBP"}, "gross": {"minor": 0, "currency": "GBP"}, "basisPoints": 2000}, "vatBreakdown": [{"basisPoints": 2000, "net": {"minor": 900, "currency": "GBP"}, "tax": {"minor": 180, "currency": "GBP"}}], "subtotal": {"minor": 1000, "currency": "GBP"}, "promotionDiscount": {"minor": 0, "currency": "GBP"}, "basketDiscount": {"minor": 100, "currency": "GBP"}, "net": {"minor": 900, "currency": "GBP"}, "tax": {"minor": 180, "currency": "GBP"}, "total": {"minor": 1080, "currency": "GBP"}}},
{"name": "the tax point picks the rate: 15% in 2009", "args": [[{"sku": "A", "unitPrice": {"minor": 1000, "currency": "GBP"}, "quantity": 1, "taxCategory": "STANDARD"}], [], {"minor": 0, "currency": "GBP"}, {"minor": 0, "currency": "GBP"}, "STANDARD", false, "GB", "2009-06-01"], "expect": {"lines": [{"sku": "A", "quantity": 1, "gross": {"minor": 1000, "currency": "GBP"}, "promotionDiscount": {"minor": 0, "currency": "GBP"}, "basketDiscount": {"minor": 0, "currency": "GBP"}, "net": {"minor": 1000, "currency": "GBP"}, "tax": {"minor": 150, "currency": "GBP"}, "total": {"minor": 1150, "currency": "GBP"}}], "promotions": [], "delivery": {"net": {"minor": 0, "currency": "GBP"}, "tax": {"minor": 0, "currency": "GBP"}, "gross": {"minor": 0, "currency": "GBP"}, "basisPoints": 1500}, "vatBreakdown": [{"basisPoints": 1500, "net": {"minor": 1000, "currency": "GBP"}, "tax": {"minor": 150, "currency": "GBP"}}], "subtotal": {"minor": 1000, "currency": "GBP"}, "promotionDiscount": {"minor": 0, "currency": "GBP"}, "basketDiscount": {"minor": 0, "currency": "GBP"}, "net": {"minor": 1000, "currency": "GBP"}, "tax": {"minor": 150, "currency": "GBP"}, "total": {"minor": 1150, "currency": "GBP"}}},
{"name": "a coupon that uses up the whole basket leaves only delivery", "args": [[{"sku": "A", "unitPrice": {"minor": 1200, "currency": "GBP"}, "quantity": 1, "taxCategory": "STANDARD"}], [], {"minor": 1200, "currency": "GBP"}, {"minor": 600, "currency": "GBP"}, "STANDARD", true, "GB", "2026-09-15"], "expect": {"lines": [{"sku": "A", "quantity": 1, "gross": {"minor": 1200, "currency": "GBP"}, "promotionDiscount": {"minor": 0, "currency": "GBP"}, "basketDiscount": {"minor": 1200, "currency": "GBP"}, "net": {"minor": 0, "currency": "GBP"}, "tax": {"minor": 0, "currency": "GBP"}, "total": {"minor": 0, "currency": "GBP"}}], "promotions": [], "delivery": {"net": {"minor": 500, "currency": "GBP"}, "tax": {"minor": 100, "currency": "GBP"}, "gross": {"minor": 600, "currency": "GBP"}, "basisPoints": 2000}, "vatBreakdown": [{"basisPoints": 2000, "net": {"minor": 500, "currency": "GBP"}, "tax": {"minor": 100, "currency": "GBP"}}], "subtotal": {"minor": 1200, "currency": "GBP"}, "promotionDiscount": {"minor": 0, "currency": "GBP"}, "basketDiscount": {"minor": 1200, "currency": "GBP"}, "net": {"minor": 500, "currency": "GBP"}, "tax": {"minor": 100, "currency": "GBP"}, "total": {"minor": 600, "currency": "GBP"}}},
{"name": "a coupon bigger than the basket after promotions is an error", "args": [[{"sku": "TEA", "unitPrice": {"minor": 250, "currency": "GBP"}, "quantity": 2, "taxCategory": "ZERO"}, {"sku": "MUG", "unitPrice": {"minor": 800, "currency": "GBP"}, "quantity": 1, "taxCategory": "STANDARD"}, {"sku": "WINE", "unitPrice": {"minor": 900, "currency": "GBP"}, "quantity": 3, "taxCategory": "STANDARD"}], [{"id": "wine-3for2", "kind": "free-items", "skus": ["WINE"], "groupSize": 3, "freeItems": 1, "basisPoints": 0, "amount": null}], {"minor": 5000, "currency": "GBP"}, {"minor": 0, "currency": "GBP"}, "STANDARD", true, "GB", "2026-09-15"], "expectError": "basketDiscount 5000 is more than the basket's 3100 after promotions"},
{"name": "delivery in another currency is an error", "args": [[{"sku": "TEA", "unitPrice": {"minor": 250, "currency": "GBP"}, "quantity": 2, "taxCategory": "ZERO"}, {"sku": "MUG", "unitPrice": {"minor": 800, "currency": "GBP"}, "quantity": 1, "taxCategory": "STANDARD"}, {"sku": "WINE", "unitPrice": {"minor": 900, "currency": "GBP"}, "quantity": 3, "taxCategory": "STANDARD"}], [], {"minor": 0, "currency": "GBP"}, {"minor": 395, "currency": "EUR"}, "STANDARD", true, "GB", "2026-09-15"], "expectError": "currency mismatch: GBP and EUR"},
{"name": "an empty basket is an error", "args": [[], [], {"minor": 0, "currency": "GBP"}, {"minor": 0, "currency": "GBP"}, "STANDARD", true, "GB", "2026-09-15"], "expectError": "a basket needs at least one line"},
{"name": "an unknown tax category is an error", "args": [[{"sku": "A", "unitPrice": {"minor": 1000, "currency": "GBP"}, "quantity": 1, "taxCategory": "LUXURY"}], [], {"minor": 0, "currency": "GBP"}, {"minor": 0, "currency": "GBP"}, "STANDARD", true, "GB", "2026-09-15"], "expectError": "no VAT rule for GB/LUXURY"},
{"name": "a negative delivery charge is an error", "args": [[{"sku": "TEA", "unitPrice": {"minor": 250, "currency": "GBP"}, "quantity": 2, "taxCategory": "ZERO"}, {"sku": "MUG", "unitPrice": {"minor": 800, "currency": "GBP"}, "quantity": 1, "taxCategory": "STANDARD"}, {"sku": "WINE", "unitPrice": {"minor": 900, "currency": "GBP"}, "quantity": 3, "taxCategory": "STANDARD"}], [], {"minor": 0, "currency": "GBP"}, {"minor": -1, "currency": "GBP"}, "STANDARD", true, "GB", "2026-09-15"], "expectError": "delivery must not be negative"}
]