This commit is contained in:
parent
fe489673be
commit
b49042a626
8 changed files with 143 additions and 28 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue