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

+2
View File
@@ -6,6 +6,7 @@ import {
Building2,
Calendar,
CalendarClock,
CalendarOff,
CalendarX2,
CheckCheck,
ClipboardList,
@@ -58,6 +59,7 @@ function getManageSections(isSuper: boolean) {
links: [
{ href: "/owner/settings/business", label: "Business Details", icon: Building2 },
{ href: "/owner/settings/hours", label: "Opening Hours", icon: CalendarClock },
{ href: "/owner/settings/holidays", label: "Holidays", icon: CalendarOff },
{ href: "/owner/settings/gallery", label: "Gallery", icon: Images },
...(isSuper
? [{ href: "/owner/settings/app", label: "App Icon & Home Screen", icon: Smartphone }]
@@ -0,0 +1,43 @@
import type { Metadata } from "next";
import { redirect } from "next/navigation";
import { auth } from "@/auth";
import { SettingsPageShell } from "@/components/settings/settings-page-shell";
import { prisma } from "@/lib/db/prisma";
import { hasPermission } from "@/lib/auth/permissions";
import { Permission } from "@/generated/prisma/enums";
import { getActingBusinessContext } from "@/lib/business/get-acting-business-context";
import { todayIn } from "@/lib/time/business-time";
import { listBusinessHolidays } from "@/services/business/holiday.service";
import { HolidaysManager } from "@/features/owner/components/holidays-manager";
export const metadata: Metadata = { title: "Holidays" };
export const dynamic = "force-dynamic";
export default async function OwnerHolidaysPage() {
const session = await auth();
if (!session?.user) redirect("/sign-in");
const canManage = await hasPermission(session.user.id, Permission.MANAGE_BUSINESS_PROFILE);
if (!canManage) redirect("/staff");
const context = await getActingBusinessContext();
if (!context) redirect("/staff");
const business = await prisma.business.findUnique({
where: { id: context.businessId },
select: { timezone: true, locale: true },
});
if (!business) redirect("/staff");
const holidays = await listBusinessHolidays(prisma, context.businessId);
return (
<SettingsPageShell title="Holidays" mainClassName="lg:max-w-2xl">
<HolidaysManager
holidays={holidays}
today={todayIn(business.timezone)}
locale={business.locale}
/>
</SettingsPageShell>
);
}