Skip to main content

Holiday Management

This guide covers managing holidays across companies, including the admin calendar holiday controls, company creation auto-seeding, and bulk import operations.


Overview

System Admin Holiday Capabilities

As a System Admin, you can manage holidays for any company on the platform:

ActionDescription
View holidaysSee all holidays for any company
Create holidaysAdd bank holidays, closures, or custom dates
Import UK bank holidaysBulk import from the UK Government API
Delete holidaysRemove holidays from any company

How Holidays Work

Holidays are company-specific. Each company has its own holiday list, which affects:

  • Leave balance calculations (holidays excluded like weekends)
  • Calendar day and week view markers
  • Shift creation warnings
  • Copy-week and bulk scheduling tools

Accessing Holiday Management

From the Admin Calendar Page

  1. Navigate to the Admin section
  2. Select a company
  3. Open the company's Calendar page
  4. Click the Calendar & Holidays button
  5. The Holiday Management panel opens

From Company Settings

  1. Navigate to the Admin section
  2. Select a company
  3. Go to SettingsHolidays tab

Both routes open the same Holiday Management component.


Auto-Seeding on Company Creation

When you create a new company through the Company Creation Wizard, Shyfts automatically:

  1. Fetches UK bank holidays for the current year and next year
  2. Inserts them into the company_holidays table with type bank_holiday
  3. If the UK Government API is unavailable, falls back to hardcoded holiday data (2025-2028)

What Gets Seeded

HolidayIncluded
New Year's DayYes
Good FridayYes
Easter MondayYes
Early May Bank HolidayYes
Spring Bank HolidayYes
Summer Bank HolidayYes
Christmas DayYes
Boxing DayYes
Substitute days (weekend holidays)Yes

Rollback Behaviour

If company creation fails after holidays have been inserted, the cleanup process removes the seeded holidays along with other company data.


Importing UK Bank Holidays

For an Existing Company

  1. Open the Holiday Management panel for the target company
  2. Click Import UK Bank Holidays
  3. Select the year (2025-2028 supported)
  4. Click Import

Import Details

AspectBehaviour
SourceUK Government API (gov.uk/bank-holidays)
RegionEngland and Wales
CachingAPI response cached for 24 hours
FallbackHardcoded data used if API unavailable
IdempotentRunning twice skips existing holidays
ResponseShows count of imported, skipped, and total

Example Response

After importing:

Imported 8 bank holidays for 2026.
Skipped 0 (already existed).
Total holidays for 2026: 8

Managing Holidays Across Companies

Holiday Types

TypeUse CaseBadge
Bank HolidayOfficial UK public holidaysAmber
Company ClosurePlanned closures (annual shutdown, refurbishment)Red
CustomTraining days, special eventsBlue

Creating Company-Specific Closures

Different companies may have different closure dates. For example:

  • A GP practice might close for an annual training day
  • A restaurant might close for refurbishment
  • An office might have a company away day

Create these as Company Closure type holidays for the specific company.

Bulk Operations

Currently, holidays are managed per-company. To add the same custom holiday to multiple companies, you need to add it to each company individually.


Holiday Impact on Operations

Leave Balance

When a holiday falls within a leave request date range, that day is not counted as a leave day. This matches the treatment of weekends.

Example: If Boxing Day (26 December) is a bank holiday and a staff member requests 23-27 December off, only the non-holiday weekdays are deducted.

Calendar Display

ViewHoliday Indicator
Day viewAmber badge in header + closed-day message with building icon
Week viewHoliday name under date + amber column tint

Shift Scheduling

ToolHoliday Behaviour
Create shiftWarning displayed when creating a shift on a holiday
Copy weekResponse includes target_week_holidays listing holidays in the target week
Bulk schedulingToast warning when holidays exist in the target week

Troubleshooting

Common Issues

IssueCauseSolution
Holidays not showing after importYear mismatchEnsure you imported the correct year
Duplicate import attemptAlready importedImport is idempotent — duplicates are skipped
API import failsNetwork or API issueHardcoded fallback data is used automatically
Holiday not affecting leave balanceHoliday added after leave was approvedExisting approved leave is not retroactively recalculated


Source Files:

  • src/components/holidays/HolidayManagement.tsx - Holiday management UI
  • src/lib/utils/bank-holidays.ts - UK Government API integration and fallback data
  • src/lib/utils/company-holidays.ts - Shared holiday query utilities
  • src/app/api/companies/create-with-manager/route.ts - Company creation with holiday seeding
  • src/app/api/companies/[companyId]/holidays/import-bank-holidays/route.ts - Bulk import endpoint