Currently, Country/Region context works only by fixing a comma separated list of countries in which a feature is enabled. In code, the same is true for the container of strings when checking if a legal entitiy is in a country/region.
I propose an extension of the simple list of countries to a "legislation". A "legislation" is a platform managed list of countries which can be added to a country/region property as. It could be managed as a metadata artifact and deployed, with an extension capability to add more countries in the future, or as a pure runtime feature. "Legislation" should have a unique string, longer than 2 characters not to collide with ISO country/region codes, or be prefixed with a non-alpha character, e.g. "+".
For example, features common to the European Union, such as VAT features, Intrastat reporting and so on, could be marked in metadata with a "legislation" +EU. Similarly, in code, checks could be rewritten from isLegalEntityInCountryRegion with a long list of countries to a short container of only "+EU".
Given that functions that are enabled for more than one country generally fall into a couple of broad categories:
- are actually there because of some super-national legislation (EU, EEU, SEPA, NAFTA, Mercosur/Mercosul...)
- are not really localization features, just features developed by a localization team (used to be payment calendars, also configurable text descriptions, withholding tax per invoice line...)
- features that exists because several countries used to be one or had some other common historical influence
it would be beneficial to be able to add new countries to at least two of the above groups of features.