Skip to content

feat: ab#2225: added public holidays as kalendertage#27

Open
witchpou wants to merge 12 commits into
sprintfrom
feature/ab#2225-special-days
Open

feat: ab#2225: added public holidays as kalendertage#27
witchpou wants to merge 12 commits into
sprintfrom
feature/ab#2225-special-days

Conversation

@witchpou

@witchpou witchpou commented Jul 6, 2026

Copy link
Copy Markdown

Description

Issue References

Feature AB#2225: added public holidays from configurable API. In Default, https://openholidaysapi.org is used, but can be configured in database table configuration or Admin Portal -> Anwenderkonfiguration.

Definition of Done

  • Acceptance criteria are met
  • Testing is done (unit-tests, DEV-environment)
  • Build/Test workflow has successfully finished
  • Release notes are complemented
  • Documentation is complemented (operator manual, system specification, etc.)

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces an automated import of public holidays from a configurable external API into Kalendertag, and adapts weekday-average calculations to include/exclude public holidays accordingly.

Changes:

  • Add public-holiday import pipeline (API client + service) with scheduled and startup execution, plus a secured manual REST trigger.
  • Extend Zeitintervall weekday-average queries to treat public holidays differently for Sunday/holiday vs weekday aggregations.
  • Add default DB configuration entry and runtime scheduling configuration for the new import job.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
src/test/java/de/muenchen/dave/services/kalendertag/PublicHolidaysImportServiceTest.java Adds unit tests for holiday import behavior and URL templating.
src/main/resources/db/migration/V18__add_public_holidays_configuration.sql Inserts default configuration for the public holidays API URL.
src/main/resources/application.yml Adds cron + ShedLock settings for the new public-holidays job.
src/main/java/de/muenchen/dave/services/ladezaehldaten/LadeZaehldatenService.java Switches weekday-average repository query based on TagesTyp to account for public holidays.
src/main/java/de/muenchen/dave/services/kalendertag/PublicHolidaysReceiver.java Adds startup + scheduled execution for importing public holidays.
src/main/java/de/muenchen/dave/services/kalendertag/PublicHolidaysImportService.java Implements public-holiday import/upsert logic and configurable source URL resolution.
src/main/java/de/muenchen/dave/services/kalendertag/OpenHolidaysApiClient.java Adds RestTemplate-based client to fetch public holidays.
src/main/java/de/muenchen/dave/repositories/relationaldb/ZeitintervallRepository.java Adds new native-query methods for weekday-average calculations with/without public holidays.
src/main/java/de/muenchen/dave/repositories/relationaldb/KalendertagRepository.java Adds bulk lookup by dates and an existence check for date ranges.
src/main/java/de/muenchen/dave/domain/Zeitintervall.java Renames/creates native queries used for weekday-average calculations and adds public-holiday logic.
src/main/java/de/muenchen/dave/domain/dtos/PublicHolidaysDTO.java Adds DTO record for the public-holidays API response.
src/main/java/de/muenchen/dave/controller/PublicHolidaysController.java Adds secured endpoint to trigger manual import.
application.yml Adds a root-level Spring config forcing local + no-security profiles.
application-local.yml Changes Flyway locations and switches report logo config to a remote URL.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/main/java/de/muenchen/dave/domain/Zeitintervall.java Outdated
Comment thread application.yml
Comment thread application-local.yml
Comment on lines 69 to +71
reports:
logo-icon: classpath:/pdf/images/kindl.jpg
logo-subtitle: "Landeshauptstadt<br/>München<br/><b>Mobilitätsreferat</b>"
logo-icon: https://www.wolfsburg.de/-/media/wolfsburg/images/alle-bilder/logos/stadt_wob_okt_2025/wolfsburg-version-a-weiss-schwarz-k.webp
logo-subtitle: "<br/>Wolfsburg<br/><b>Straßenbau und Projektkoordination (07)</b>"
Comment thread src/main/resources/application.yml
Comment on lines +28 to +31
public ResponseEntity<Integer> loadPublicHolidaysForYear() {
try {
int result = publicHolidaysImportService.importForCurrentAndNextYear();
return new ResponseEntity<>(result, HttpStatus.OK);
Comment on lines +87 to +96
public int importForCurrentAndNextYear() {
final int currentYear = LocalDate.now().getYear();
int totalImported = 0;
for (int year = currentYear; year <= currentYear + 1; year++) {
try {
totalImported += loadAndSavePublicHolidaysForYear(year);
} catch (final Exception exception) {
log.error("Error while loading public holidays for year {}", year, exception);
}
}
witchpou and others added 3 commits July 7, 2026 16:17
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 17 out of 17 changed files in this pull request and generated 8 comments.

Comment thread src/main/java/de/muenchen/dave/domain/Zeitintervall.java Outdated
Comment on lines 121 to 123
try {
return ResponseEntity.ok(this.externalZaehlungPersistierungsService.getZaehlungenForExternal(SecurityContextInformationExtractor.getUserName(),
return ResponseEntity.ok(this.externalZaehlungPersistierungsService.getZaehlungenForExternal("starwit",
SecurityContextInformationExtractor.isFachadmin()));
Comment on lines +51 to +54
} else if (dataExistsForYear) {
log.info("{} for year {} already exist, overriding existing data", tagesTyp.getBeschreibung(), year);
kalendertagRepository.deleteAllByDatumBetweenAndTagestyp(validFrom, validTo, tagesTyp);
}
Comment thread src/main/java/de/muenchen/dave/services/kalendertag/HolidaysImportService.java Outdated
Comment thread src/main/java/de/muenchen/dave/services/kalendertag/OpenHolidaysApiClient.java Outdated
Comment thread application.yml
Comment thread application-local.yml Outdated
Comment thread application-local.yml
Comment on lines 69 to +71
reports:
logo-icon: classpath:/pdf/images/kindl.jpg
logo-subtitle: "Landeshauptstadt<br/>München<br/><b>Mobilitätsreferat</b>"
logo-icon: https://www.wolfsburg.de/-/media/wolfsburg/images/alle-bilder/logos/stadt_wob_okt_2025/wolfsburg-version-a-weiss-schwarz-k.webp
logo-subtitle: "<br/>Wolfsburg<br/><b>Straßenbau und Projektkoordination (07)</b>"
witchpou and others added 6 commits July 8, 2026 00:54
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants