holidays feature
CI / ci (push) Canceled after 0s

The owner page

Where: Manage → Business → Holidays, at /owner/settings/holidays. It needs the same permission as Business Details.
Adding: you enter a name, a start date and an optional end date. Leaving the end empty gives a single day.
Upcoming and past: upcoming holidays are listed by date, with a trash icon to remove each one. Past ones sit in a collapsed “Past” list.
Existing bookings: if appointments are already booked on those dates, you see them and confirm with “Add Anyway”, the same pattern as Opening Hours. Nothing is cancelled automatically.

What it does to booking

Customer calendar: holiday dates are greyed out, for every staff member and every service.
Time slots: no slots are offered on those dates.
Direct bookings: staff and owner bookings and reschedules onto a holiday are refused, with a message naming the holiday. This is deliberate, but if you want owners to be able to override it, that’s a small change.
This commit is contained in:
Stefan Lazic committed 2026-10-17 12:23:53 +01:00
1 parent 31c48296d9
commit 9f981173f4
13 files changed
+914 -3

No files matched your search

+21
View File
@@ -344,6 +344,7 @@ model Business {
locations BusinessLocation[]
hours BusinessHours[]
holidays BusinessHoliday[]
settings BusinessSettings?
bookingRule BookingRule?
serviceCategories ServiceCategory[]
@@ -436,6 +437,26 @@ model BusinessSettings {
/// Scheduling policy — see docs/implementation-plan.md §6/§16. Every field
/// has a sane default so the row can be created once at business setup and
/// tuned later without a migration.
/// A date range the whole business is closed — bank holidays, annual leave,
/// a refit — on top of the weekly BusinessHours. Both dates are inclusive
/// calendar dates in the business's own timezone (no time component), the
/// same convention as TimeOff. Availability treats every date in range as
/// closed for every staff member; see availability.service.ts.
model BusinessHoliday {
id String @id @default(cuid())
businessId String
business Business @relation(fields: [businessId], references: [id], onDelete: Cascade)
name String
startDate DateTime @db.Date
endDate DateTime @db.Date
createdAt DateTime @default(now())
@@index([businessId, startDate, endDate])
}
model BookingRule {
id String @id @default(cuid())