Repository: urlaubsverwaltung/urlaubsverwaltung (java)

Issue:
USA Feiertage - Washington, D.C., Virginia und Maryland.
Als Mitarbeitenden, welche in der USA arbeiten, möchte ich die passenden Feiertage in der Urlaubsverwaltung nutzen können. Da die USA sehr groß ist und es viele Feiertage gibt, möchten wir zunächst mit:

* Washington, D.C.
* Virginia 
* Maryland

starten

Pull request:
public holidays: Add parts of  the usa 
closes #5009 

<!--

Thanks for contributing to the Urlaubsverwaltung.
Please review the following notes before submitting you pull request.

Please look for other issues or pull requests which already work on this topic. Is somebody already on it? Do you need to synchronize?

# Security Vulnerabilities

🛑 STOP! 🛑 If your contribution fixes a security vulnerability, please do not submit it.
Instead, please open a report of a security vulnerability via
[Report a security vulnerability](https://github.com/urlaubsverwaltung/urlaubsverwaltung/security/advisories/new)


# Describing Your Changes

If, having reviewed the notes above, you're ready to submit your pull request, please
provide a brief description of the proposed changes.

If they:
 🐞 fix a bug, please describe the broken behaviour and how the changes fix it.
    Please label with 'type: bug' and 'status: new'
    
 🎁 make an enhancement, please describe the new functionality and why you believe it's useful.
    Please label with 'type: enhancement' and 'status: new'
 
If your pull request relates to any existing issues,
please reference them by using the issue number prefixed with #.

-->


Patch:
diff --git a/src/main/java/org/synyx/urlaubsverwaltung/publicholiday/PublicHolidayConfiguration.java b/src/main/java/org/synyx/urlaubsverwaltung/publicholiday/PublicHolidayConfiguration.java
index 50f741c60..ce9766c39 100644
--- a/src/main/java/org/synyx/urlaubsverwaltung/publicholiday/PublicHolidayConfiguration.java
+++ b/src/main/java/org/synyx/urlaubsverwaltung/publicholiday/PublicHolidayConfiguration.java
@@ -14,7 +14,7 @@ import static java.util.stream.Collectors.toMap;
 @Configuration
 class PublicHolidayConfiguration {
 
-    private static final List<String> COUNTRIES = List.of("de", "at", "ch", "gb", "gr", "mt", "it", "hr", "es", "nl", "lt", "be", "pl");
+    private static final List<String> COUNTRIES = List.of("at", "be", "ch", "de", "es", "gb", "gr", "hr", "it", "lt", "mt", "nl", "pl", "us");
 
     @Bean
     Map<String, HolidayManager> holidayManagerMap() {
diff --git a/src/main/java/org/synyx/urlaubsverwaltung/workingtime/FederalState.java b/src/main/java/org/synyx/urlaubsverwaltung/workingtime/FederalState.java
index eb7538d2a..0fa7e88bc 100644
--- a/src/main/java/org/synyx/urlaubsverwaltung/workingtime/FederalState.java
+++ b/src/main/java/org/synyx/urlaubsverwaltung/workingtime/FederalState.java
@@ -118,7 +118,11 @@ public enum FederalState {
 
     BELGIUM("be", "be"),
 
-    POLAND("pl", "pl");
+    POLAND("pl", "pl"),
+
+    USA_MARYLAND("us", "md"),
+    USA_VIRGINIA("us", "va"),
+    USA_WASHINGTON_DC("us", "dc");
 
     private final String[] codes;
 
diff --git a/src/main/resources/messages.properties b/src/main/resources/messages.properties
index ed186aa4d..c138acf97 100644
--- a/src/main/resources/messages.properties
+++ b/src/main/resources/messages.properties
@@ -1147,6 +1147,7 @@ country.nl=Niederlande
 country.lt=Litauen
 country.be=Belgien
 country.pl=Polen
+country.us=Vereinigte Staaten von Amerika
 
 # No Federal States
 federalState.NONE=Keine Feiertagesregelung
@@ -1269,6 +1270,11 @@ federalState.BELGIUM=Belgien
 # Federal States Poland
 federalState.POLAND=Polen
 
+# Federal States USA
+federalState.USA_MARYLAND=Maryland
+federalState.USA_VIRGINIA=Virginia
+federalState.USA_WASHINGTON_DC=Washington, D.C.
+
 # DEPARTMENTS
 departments.header.title=Abteilungsübersicht
 departments.title=Abteilungen
diff --git a/src/main/resources/messages_de_AT.properties b/src/main/resources/messages_de_AT.properties
index 993939345..0572dcb88 100644
--- a/src/main/resources/messages_de_AT.properties
+++ b/src/main/resources/messages_de_AT.properties
@@ -1095,6 +1095,7 @@ country.nl=Niederlande
 country.lt=Litauen
 country.be=Belgien
 country.pl=Polen
+country.us=Vereinigte Staaten von Amerika
 
 # No Federal States
 federalState.NONE=Keine Feiertagesregelung
@@ -1217,6 +1218,11 @@ federalState.BELGIUM=Belgien
 # Federal States Poland
 federalState.POLAND=Polen
 
+# Federal States USA
+federalState.USA_MARYLAND=Maryland
+federalState.USA_VIRGINIA=Virginia
+federalState.USA_WASHINGTON_DC=Washington, D.C.
+
 # DEPARTMENTS
 departments.header.title=Abteilungsübersicht
 departments.title=Abteilungen
diff --git a/src/main/resources/messages_el.properties b/src/main/resources/messages_el.properties
index 80a4c38e5..b39137065 100644
--- a/src/main/resources/messages_el.properties
+++ b/src/main/resources/messages_el.properties
@@ -1039,6 +1039,7 @@ country.nl=Ολλανδία
 country.lt=Λιθουανία
 country.be=Βέλγιο
 country.pl=Πολωνία
+country.us=Ηνωμένες Πολιτείες της Αμερικής
 
 # No Federal States
 federalState.NONE=Κανένας κανονισμός επίσημων αργιών
@@ -1161,6 +1162,11 @@ federalState.BELGIUM=Βέλγιο
 # Federal States Poland
 federalState.POLAND=Πολωνία
 
+# Federal States USA
+federalState.USA_MARYLAND=Μέριλαντ
+federalState.USA_VIRGINIA=Βιρτζίνια
+federalState.USA_WASHINGTON_DC=Ουάσινγκτον, D.C.
+
 # DEPARTMENTS
 departments.header.title=Επισκόπηση τμημάτων
 departments.title=Τμήματα
diff --git a/src/main/resources/messages_en.properties b/src/main/resources/messages_en.properties
index 88f83a243..4493932e6 100644
--- a/src/main/resources/messages_en.properties
+++ b/src/main/resources/messages_en.properties
@@ -1113,6 +1113,7 @@ country.nl=The Netherlands
 country.lt=Lithuania
 country.be=Belgium
 country.pl=Poland
+country.us=United States of America
 
 # No Federal States
 federalState.NONE=No public holiday regulation
@@ -1235,6 +1236,11 @@ federalState.BELGIUM=Belgium
 # Federal States Poland
 federalState.POLAND=Poland
 
+# Federal States USA
+federalState.USA_MARYLAND=Maryland
+federalState.USA_VIRGINIA=Virginia
+federalState.USA_WASHINGTON_DC=Washington, D.C.
+
 # DEPARTMENTS
 departments.header.title=Departments overview
 departments.title=Departments


Test patch:
diff --git a/src/test/java/org/synyx/urlaubsverwaltung/publicholiday/PublicHolidayConfigurationTest.java b/src/test/java/org/synyx/urlaubsverwaltung/publicholiday/PublicHolidayConfigurationTest.java
index 0f903adb4..c85d533c6 100644
--- a/src/test/java/org/synyx/urlaubsverwaltung/publicholiday/PublicHolidayConfigurationTest.java
+++ b/src/test/java/org/synyx/urlaubsverwaltung/publicholiday/PublicHolidayConfigurationTest.java
@@ -13,7 +13,7 @@ class PublicHolidayConfigurationTest {
     void ensureThatHolidaysManagerMapContainsAllKeys() {
         final Map<String, HolidayManager> holidayManagers = new PublicHolidayConfiguration().holidayManagerMap();
         assertThat(holidayManagers)
-                .hasSize(13)
-                .containsKeys("de", "at", "ch", "gb", "gr", "mt", "it", "hr", "es", "nl", "lt", "be", "pl");
+                .hasSize(14)
+                .containsKeys("de", "at", "ch", "gb", "gr", "mt", "it", "hr", "es", "nl", "lt", "be", "pl", "us");
     }
 }
diff --git a/src/test/java/org/synyx/urlaubsverwaltung/workingtime/FederalStateTest.java b/src/test/java/org/synyx/urlaubsverwaltung/workingtime/FederalStateTest.java
index 56213a851..fbd523fc6 100644
--- a/src/test/java/org/synyx/urlaubsverwaltung/workingtime/FederalStateTest.java
+++ b/src/test/java/org/synyx/urlaubsverwaltung/workingtime/FederalStateTest.java
@@ -105,6 +105,9 @@ import static org.synyx.urlaubsverwaltung.workingtime.FederalState.UNITED_KINGDO
 import static org.synyx.urlaubsverwaltung.workingtime.FederalState.UNITED_KINGDOM_NORTHERN_IRELAND;
 import static org.synyx.urlaubsverwaltung.workingtime.FederalState.UNITED_KINGDOM_SCOTLAND;
 import static org.synyx.urlaubsverwaltung.workingtime.FederalState.UNITED_KINGDOM_WALES;
+import static org.synyx.urlaubsverwaltung.workingtime.FederalState.USA_MARYLAND;
+import static org.synyx.urlaubsverwaltung.workingtime.FederalState.USA_VIRGINIA;
+import static org.synyx.urlaubsverwaltung.workingtime.FederalState.USA_WASHINGTON_DC;
 
 /**
  * Unit test for {@link FederalState}.
@@ -217,7 +220,11 @@ class FederalStateTest {
 
             Arguments.of(BELGIUM, "be", null),
 
-            Arguments.of(POLAND, "pl", null)
+            Arguments.of(POLAND, "pl", null),
+
+            Arguments.of(USA_MARYLAND, "md", null),
+            Arguments.of(USA_VIRGINIA, "va", null),
+            Arguments.of(USA_WASHINGTON_DC, "dc", null)
         );
     }
 
@@ -332,7 +339,11 @@ class FederalStateTest {
             Arguments.of(SPAIN_ASTURIAS, "es"),
             Arguments.of(SPAIN_EUSKADI, "es"),
             Arguments.of(SPAIN_CANTABRIA, "es"),
-            Arguments.of(SPAIN_VALENCIA, "es")
+            Arguments.of(SPAIN_VALENCIA, "es"),
+
+            Arguments.of(USA_MARYLAND, "us"),
+            Arguments.of(USA_VIRGINIA, "us"),
+            Arguments.of(USA_WASHINGTON_DC, "us")
         );
     }
 
@@ -358,8 +369,9 @@ class FederalStateTest {
         final List<FederalState> ltFederalStates = Arrays.stream(FederalState.values()).filter(federalState -> "lt".equals(federalState.getCountry())).toList();
         final List<FederalState> beFederalStates = Arrays.stream(FederalState.values()).filter(federalState -> "be".equals(federalState.getCountry())).toList();
         final List<FederalState> plFederalStates = Arrays.stream(FederalState.values()).filter(federalState -> "pl".equals(federalState.getCountry())).toList();
+        final List<FederalState> usFederalStates = Arrays.stream(FederalState.values()).filter(federalState -> "us".equals(federalState.getCountry())).toList();
 
-        assertThat(federalStatesTypesByCountry).hasSize(13)
+        assertThat(federalStatesTypesByCountry).hasSize(14)
             .contains(entry("de", deFederalStates))
             .contains(entry("at", atFederalStates))
             .contains(entry("ch", chFederalStates))
@@ -372,6 +384,7 @@ class FederalStateTest {
             .contains(entry("nl", nlFederalStates))
             .contains(entry("lt", ltFederalStates))
             .contains(entry("be", beFederalStates))
-            .contains(entry("pl", plFederalStates));
+            .contains(entry("pl", plFederalStates))
+            .contains(entry("us", usFederalStates));
     }
 }