Consolidate API requests and update ICS locations and descriptions for multi-state holidays - #32
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The API requests have been updated to query all federal states simultaneously, consolidating the data into a single raw JSON. As a result, the architecture has been simplified to use just one override file and one output result JSON. This change makes it possible to display information about holidays in other states when generating ICS files, which resolves #28.
To achieve this, each holiday now features a Location field containing the abbreviations of all applicable states. In individual state ICS files, the target state's information is prioritized first, followed by the remaining states sorted alphabetically. Furthermore, the event description has been enhanced to explicitly show where the holiday applies: it either states that the holiday is nationwide or lists the specific states in a list.
Examples
For a Baden-Württemberg (BW) file, the location field prioritizes BW first:
For a Mecklenburg-Vorpommern (MV) file, MV is placed at the beginning:
When a holiday applies nationwide, the description is set as follows:
If the holiday is regional, the description lists the specific states: