.. include:: /Includes.rst.txt .. _feature-1791793662: ========================================= Feature: Holidays from official calendars ========================================= Description =========== A country package may name, for each region, the official machine-readable calendar (iCalendar) of its public holidays. HR subscribes a holiday calendar to it in :guilabel:`Administration > Holiday rules`, tab :guilabel:`Holiday calendars`, with :guilabel:`Subscribe to an official calendar`. adsum imports the holidays at once as rules of the new origin :guilabel:`Official calendar` (source ``feed``), scoped to that holiday calendar, and refreshes them every hour once the feed's refresh interval has passed. When the feed cannot be fetched or read, the holidays of the last good import stay, the calendar shows :guilabel:`Failed, last import kept`, and HR and the admins get the new notification ``time.holidayFeedFailed`` naming the calendar and the feed, once until a refresh succeeds again. The API offers ``POST`` and ``DELETE /api/v1/holiday-calendars/{id}/feed``; a holiday calendar carries its ``feed`` with status and import times, a holiday region its ``feed`` address, and ``/holiday-regions?withFeed=1`` lists the regions with one. The new message ``HolidayFeedFailed`` is published after the commit. Impact ====== Country packages implement the new method ``HolidaySource::feedOf()``. The package for Germany names no feed, since no German state publishes an official holiday calendar; German regions keep their rules. The rule types fixed date, Easter-relative, weekday before a date and once stay for regions without a feed. Working time requires ``sabre/vobject`` to read the feeds. .. index:: API, Database, Frontend, package:adsum-working-time, package:adsum-country-de