new logo
All checks were successful
Deploy / build-deploy (push) Successful in 5m32s

This commit is contained in:
Jorijn van der Graaf 2026-08-05 23:52:40 +02:00
commit b49042a626
8 changed files with 143 additions and 28 deletions

View file

@ -69,13 +69,17 @@ export std::string FormatEuro(std::int64_t minor) {
// Note NIR/GB: the UK left; Northern Ireland's special goods status is not
// modelled — GB is simply non-EU here, which is the correct default for a
// consumer parcel.
export bool IsEuCountry(std::string_view cc) {
export std::span<const std::string_view> EuCountries() {
static constexpr std::array<std::string_view, 27> eu{
"AT", "BE", "BG", "HR", "CY", "CZ", "DE", "DK", "EE", "ES", "FI",
"FR", "GR", "HU", "IE", "IT", "LT", "LU", "LV", "MT", "NL", "PL",
"PT", "RO", "SE", "SI", "SK",
};
return std::ranges::find(eu, cc) != eu.end();
return eu;
}
export bool IsEuCountry(std::string_view cc) {
return std::ranges::find(EuCountries(), cc) != EuCountries().end();
}
// Shipping zones. Three tiers is deliberate — real carrier pricing has more