Update hivegrid-cloud reference to latest main
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e98d38e716
commit
7b21524c86
3781 files changed
+373484
-225607
No files matched your search
+88
@@ -0,0 +1,88 @@
|
||||
// AK-P16b · booking-page editor (M06 Block E.2) — shared loader/action for the `new`
|
||||
// and `:id` routes. bookings.admin only. Validates the slug (reserved + unique) and
|
||||
// upserts the page + its provider links. The loader exposes the absolute public URL +
|
||||
// an iframe embed snippet (M06 Block H, DoD 3) for the copy-to-clipboard generator.
|
||||
|
||||
import { type LoaderFunctionArgs, type ActionFunctionArgs, data, redirect } from "react-router";
|
||||
import { validateCSRFToken } from "~/utils/session.server";
|
||||
import { loadBookingContext, requireBookingPermission, BOOKING_PERMISSIONS } from "./bookingAccess.server";
|
||||
import { RESERVED_BOOKING_SLUGS, bookingPagesListPath, publicBookingPath, publicBookingEmbedPath, notFoundResponse } from "./bookingRoutePaths";
|
||||
import { getBookingPageForEdit, createBookingPage, updateBookingPage, isSlugTaken, type BookingPageEdit } from "../db/booking.db.server";
|
||||
|
||||
export interface BookingPageEditorLoaderData {
|
||||
readonly mode: "new" | "edit";
|
||||
readonly tenantSlug: string;
|
||||
readonly page: BookingPageEdit | null;
|
||||
readonly publicUrl: string | null;
|
||||
readonly embedCode: string | null;
|
||||
}
|
||||
|
||||
export type BookingPageEditorActionData = { readonly ok: false; readonly errorKey: string; readonly field?: string };
|
||||
|
||||
function embedSnippet(url: string): string {
|
||||
return `<iframe src="${url}" width="100%" height="700" frameborder="0" style="border:none"></iframe>`;
|
||||
}
|
||||
|
||||
export async function bookingPageEditorLoader({ request, params }: LoaderFunctionArgs) {
|
||||
const ctx = await loadBookingContext({ request, params, requireModule: true });
|
||||
requireBookingPermission(ctx, BOOKING_PERMISSIONS.admin);
|
||||
const tenantSlug = params.tenant ?? "";
|
||||
const origin = new URL(request.url).origin;
|
||||
|
||||
const page = params.id ? await getBookingPageForEdit(ctx.tenantId, params.id) : null;
|
||||
if (params.id && !page) {
|
||||
throw notFoundResponse();
|
||||
}
|
||||
const publicUrl = page ? `${origin}${publicBookingPath(tenantSlug, page.slug)}` : null;
|
||||
const embedCode = page ? embedSnippet(`${origin}${publicBookingEmbedPath(tenantSlug, page.slug)}`) : null;
|
||||
|
||||
return data<BookingPageEditorLoaderData>({ mode: params.id ? "edit" : "new", tenantSlug, page, publicUrl, embedCode });
|
||||
}
|
||||
|
||||
export async function bookingPageEditorAction({ request, params }: ActionFunctionArgs) {
|
||||
const ctx = await loadBookingContext({ request, params, requireModule: true });
|
||||
requireBookingPermission(ctx, BOOKING_PERMISSIONS.admin);
|
||||
await validateCSRFToken(request);
|
||||
|
||||
const form = await request.formData();
|
||||
const slug = ((form.get("slug") as string | null) ?? "").trim().toLowerCase();
|
||||
const title = ((form.get("title") as string | null) ?? "").trim();
|
||||
|
||||
if (!/^[a-z0-9-]{3,60}$/u.test(slug)) {
|
||||
return data<BookingPageEditorActionData>({ ok: false, errorKey: "bookings.error.slugReserved", field: "slug" }, { status: 400 });
|
||||
}
|
||||
if (RESERVED_BOOKING_SLUGS.has(slug)) {
|
||||
return data<BookingPageEditorActionData>({ ok: false, errorKey: "bookings.error.slugReserved", field: "slug" }, { status: 400 });
|
||||
}
|
||||
if (await isSlugTaken(ctx.tenantId, slug, params.id)) {
|
||||
return data<BookingPageEditorActionData>({ ok: false, errorKey: "bookings.error.slugTaken", field: "slug" }, { status: 409 });
|
||||
}
|
||||
|
||||
const providerUserIds = ((form.get("providers") as string | null) ?? "")
|
||||
.split(",")
|
||||
.map((s) => s.trim())
|
||||
.filter(Boolean);
|
||||
if (providerUserIds.length === 0) {
|
||||
return data<BookingPageEditorActionData>({ ok: false, errorKey: "bookings.error.providerRequired", field: "providers" }, { status: 400 });
|
||||
}
|
||||
|
||||
const input = {
|
||||
tenantId: ctx.tenantId,
|
||||
createdByUserId: ctx.userId,
|
||||
slug,
|
||||
title: title || slug,
|
||||
description: (form.get("description") as string | null) ?? null,
|
||||
durationMinutes: Number(form.get("durationMinutes")) || 30,
|
||||
confirmationEmailSubject: ((form.get("confirmationEmailSubject") as string | null) ?? "").trim() || `Bestätigung: ${title || slug}`,
|
||||
confirmationEmailBody: ((form.get("confirmationEmailBody") as string | null) ?? "").trim() || "Dein Termin ist bestätigt.",
|
||||
isPublished: form.get("isPublished") === "on" || form.get("isPublished") === "true",
|
||||
providerUserIds,
|
||||
};
|
||||
|
||||
if (params.id) {
|
||||
await updateBookingPage(params.id, input);
|
||||
} else {
|
||||
await createBookingPage(input);
|
||||
}
|
||||
return redirect(bookingPagesListPath(params.tenant ?? ""));
|
||||
}
|
||||
+136
@@ -0,0 +1,136 @@
|
||||
// AK-P16b · public booking flow (M06 Block G) — loader + action shared by the
|
||||
// canonical `/b/{tenant}/{slug}` route and its `/embed` iframe variant. NO auth, NO
|
||||
// session CSRF (there is no logged-in user); abuse is bounded by a honeypot + the
|
||||
// GDPR-acceptance gate + the slot re-check on submit. The tenant is resolved from
|
||||
// the URL slug; an unknown/inactive tenant or unpublished page is a 404 with the
|
||||
// same Klartext (never leaks tenant existence, M06 G.4/K.6).
|
||||
|
||||
import { type LoaderFunctionArgs, type ActionFunctionArgs, data, redirect } from "react-router";
|
||||
import { formatInTimeZone } from "date-fns-tz";
|
||||
import { notFoundResponse } from "./bookingRoutePaths";
|
||||
import { resolvePublicBookingPage } from "../db/booking.db.server";
|
||||
import { loadSlotsForDate } from "../services/SlotQueryService.server";
|
||||
import { pickFirstAvailableProvider } from "../services/slotEngine";
|
||||
import { submitBooking, BookingValidationError, BookingSlotTakenError } from "../services/BookingSubmitService.server";
|
||||
|
||||
const DEFAULT_TZ = "Europe/Berlin";
|
||||
|
||||
export interface PublicBookingSlotVM {
|
||||
readonly startAtIso: string;
|
||||
readonly label: string;
|
||||
}
|
||||
|
||||
export interface PublicBookingLoaderData {
|
||||
readonly tenantSlug: string;
|
||||
readonly slug: string;
|
||||
readonly title: string;
|
||||
readonly description: string | null;
|
||||
readonly tenantName: string;
|
||||
readonly durationMinutes: number;
|
||||
readonly date: string;
|
||||
readonly timezone: string;
|
||||
readonly slots: PublicBookingSlotVM[];
|
||||
readonly isEmbed: boolean;
|
||||
}
|
||||
|
||||
export type PublicBookingActionData =
|
||||
| { readonly ok: true; readonly titleLabel: string; readonly dateLabel: string; readonly timeLabel: string; readonly icsBase64: string }
|
||||
| { readonly ok: false; readonly errorKey: string; readonly field?: string };
|
||||
|
||||
function resolveTimezone(url: URL): string {
|
||||
return url.searchParams.get("tz") || DEFAULT_TZ;
|
||||
}
|
||||
|
||||
function resolveDate(url: URL, timezone: string, now: Date): string {
|
||||
const requested = url.searchParams.get("date");
|
||||
if (requested && /^\d{4}-\d{2}-\d{2}$/u.test(requested)) {
|
||||
return requested;
|
||||
}
|
||||
return formatInTimeZone(now, timezone, "yyyy-MM-dd");
|
||||
}
|
||||
|
||||
async function buildSlots(tenantId: string, providerUserIds: string[], date: string, config: Parameters<typeof loadSlotsForDate>[0]["config"], timezone: string, now: Date): Promise<PublicBookingSlotVM[]> {
|
||||
const slots = await loadSlotsForDate({ tenantId, providerUserIds, date, config, now });
|
||||
return slots
|
||||
.filter((slot) => pickFirstAvailableProvider(slot) !== null)
|
||||
.map((slot) => ({ startAtIso: slot.startAt.toISOString(), label: formatInTimeZone(slot.startAt, timezone, "HH:mm") }));
|
||||
}
|
||||
|
||||
export async function publicBookingLoader({ request, params }: LoaderFunctionArgs) {
|
||||
const page = await resolvePublicBookingPage(params.tenant ?? "", params.slug ?? "");
|
||||
if (!page) {
|
||||
throw notFoundResponse();
|
||||
}
|
||||
const url = new URL(request.url);
|
||||
const now = new Date();
|
||||
const timezone = resolveTimezone(url);
|
||||
const date = resolveDate(url, timezone, now);
|
||||
const slots = await buildSlots(page.tenantId, page.providerUserIds, date, page.config, timezone, now);
|
||||
|
||||
const payload: PublicBookingLoaderData = {
|
||||
tenantSlug: page.tenantSlug,
|
||||
slug: page.slug,
|
||||
title: page.title,
|
||||
description: page.description,
|
||||
tenantName: page.tenantName,
|
||||
durationMinutes: page.durationMinutes,
|
||||
date,
|
||||
timezone,
|
||||
slots,
|
||||
isEmbed: url.pathname.endsWith("/embed"),
|
||||
};
|
||||
return data(payload);
|
||||
}
|
||||
|
||||
export async function publicBookingAction({ request, params }: ActionFunctionArgs) {
|
||||
const page = await resolvePublicBookingPage(params.tenant ?? "", params.slug ?? "");
|
||||
if (!page) {
|
||||
throw notFoundResponse();
|
||||
}
|
||||
const form = await request.formData();
|
||||
|
||||
// Honeypot: real users never fill this hidden field (M06 abuse guard).
|
||||
if ((form.get("company") as string | null)?.trim()) {
|
||||
return data<PublicBookingActionData>({ ok: false, errorKey: "bookings.error.submitFailed" }, { status: 400 });
|
||||
}
|
||||
|
||||
const url = new URL(request.url);
|
||||
const timezone = (form.get("tz") as string | null) || resolveTimezone(url);
|
||||
const date = (form.get("date") as string | null) ?? "";
|
||||
const startAtIso = (form.get("startAt") as string | null) ?? "";
|
||||
|
||||
try {
|
||||
const result = await submitBooking({
|
||||
page,
|
||||
startAtIso,
|
||||
date,
|
||||
viewerTimeZone: timezone,
|
||||
intake: {
|
||||
vorname: (form.get("vorname") as string | null) ?? "",
|
||||
nachname: (form.get("nachname") as string | null) ?? "",
|
||||
email: (form.get("email") as string | null) ?? "",
|
||||
telefon: (form.get("telefon") as string | null) ?? undefined,
|
||||
gdprAccepted: form.get("gdpr") === "on" || form.get("gdpr") === "true",
|
||||
},
|
||||
now: new Date(),
|
||||
});
|
||||
if (result.redirectUrl) {
|
||||
return redirect(result.redirectUrl);
|
||||
}
|
||||
return data<PublicBookingActionData>({
|
||||
ok: true,
|
||||
titleLabel: page.title,
|
||||
dateLabel: formatInTimeZone(result.startAt, timezone, "dd.MM.yyyy"),
|
||||
timeLabel: formatInTimeZone(result.startAt, timezone, "HH:mm"),
|
||||
icsBase64: result.icsBase64,
|
||||
});
|
||||
} catch (error) {
|
||||
if (error instanceof BookingValidationError) {
|
||||
return data<PublicBookingActionData>({ ok: false, errorKey: error.code, field: error.field }, { status: 400 });
|
||||
}
|
||||
if (error instanceof BookingSlotTakenError) {
|
||||
return data<PublicBookingActionData>({ ok: false, errorKey: "bookings.error.slotTaken" }, { status: 409 });
|
||||
}
|
||||
return data<PublicBookingActionData>({ ok: false, errorKey: "bookings.error.submitFailed" }, { status: 500 });
|
||||
}
|
||||
}
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import { describe, expect, test } from "vitest";
|
||||
import { resolveRepoPath } from "~/utils/testing/repoPaths";
|
||||
|
||||
// AK-P16b · static authorization-boundary guard for the booking mutation routes
|
||||
// (DoD A.5 / DoD 6). Asserts every state-changing action runs the module/permission
|
||||
// guard, the owner-check (where applicable) and CSRF validation BEFORE it reads the
|
||||
// form body — so a missing module/permission/owner/CSRF can never reach a mutation.
|
||||
|
||||
const appRoot = resolveRepoPath("apps/web/app");
|
||||
|
||||
describe("booking route authorization boundary", () => {
|
||||
test("appointment detail action guards permission + CSRF + owner before parsing the form", () => {
|
||||
const source = fs.readFileSync(path.join(appRoot, "routes/app.$tenant/bookings.$id.tsx"), "utf8");
|
||||
const formDataAt = source.indexOf("await request.formData()");
|
||||
expect(formDataAt).toBeGreaterThanOrEqual(0);
|
||||
|
||||
const permissionAt = source.indexOf("requireBookingPermission(ctx, BOOKING_PERMISSIONS.readOwn)", source.indexOf("export const action"));
|
||||
const csrfAt = source.indexOf("await validateCSRFToken(request)");
|
||||
const ownerAt = source.indexOf("requireAppointmentOwner(ctx, appt.providerUserId)", source.indexOf("export const action"));
|
||||
|
||||
expect(permissionAt).toBeGreaterThanOrEqual(0);
|
||||
expect(csrfAt).toBeGreaterThanOrEqual(0);
|
||||
expect(ownerAt).toBeGreaterThanOrEqual(0);
|
||||
expect(permissionAt).toBeLessThan(formDataAt);
|
||||
expect(csrfAt).toBeLessThan(formDataAt);
|
||||
expect(ownerAt).toBeLessThan(formDataAt);
|
||||
});
|
||||
|
||||
test("appointment detail mutation intents use write/admin permissions for lifecycle changes", () => {
|
||||
const source = fs.readFileSync(path.join(appRoot, "routes/app.$tenant/bookings.$id.tsx"), "utf8");
|
||||
|
||||
expect(source).toContain("rescheduleAppointment");
|
||||
expect(source).toContain("reassignAppointment");
|
||||
expect(source.match(/requireBookingPermission\(ctx, BOOKING_PERMISSIONS\.write\)/g)?.length ?? 0).toBeGreaterThanOrEqual(4);
|
||||
expect(source).toContain("requireBookingPermission(ctx, BOOKING_PERMISSIONS.admin)");
|
||||
expect(source).toContain('intent === "reschedule"');
|
||||
expect(source).toContain('intent === "reassign"');
|
||||
});
|
||||
|
||||
test("booking-page editor action guards admin permission + CSRF before parsing the form", () => {
|
||||
const source = fs.readFileSync(path.join(appRoot, "modules/booking/routes/BookingPageEditor.server.ts"), "utf8");
|
||||
const formDataAt = source.indexOf("await request.formData()");
|
||||
expect(formDataAt).toBeGreaterThanOrEqual(0);
|
||||
|
||||
const permissionAt = source.indexOf("requireBookingPermission(ctx, BOOKING_PERMISSIONS.admin)", source.indexOf("bookingPageEditorAction"));
|
||||
const csrfAt = source.indexOf("await validateCSRFToken(request)");
|
||||
expect(permissionAt).toBeGreaterThanOrEqual(0);
|
||||
expect(csrfAt).toBeGreaterThanOrEqual(0);
|
||||
expect(permissionAt).toBeLessThan(formDataAt);
|
||||
expect(csrfAt).toBeLessThan(formDataAt);
|
||||
});
|
||||
});
|
||||
+94
@@ -0,0 +1,94 @@
|
||||
// AK-P16b · shared loader/action guard for the booking module (mirrors
|
||||
// calendarAccess). Booking is feature-gated by its OWN `booking` key
|
||||
// (tenantHasModule, M06 DoD 7). The bookings.* bundle is cumulative (M06 Block K):
|
||||
// read_own < read_all < write < admin. Module-off 404s on write (Bauprinzip
|
||||
// A.5.3); a permission/owner miss is a 404, never a 403.
|
||||
//
|
||||
// The PUBLIC booking flow (/b/{tenant}/{slug}) does NOT use this guard — it resolves
|
||||
// the tenant from the URL segment and has no logged-in user (see the public route).
|
||||
|
||||
import { CatalogError, foundationErrors } from "@hivegrid/foundation";
|
||||
import { requireAuth } from "~/utils/loaders.middleware";
|
||||
import { getTenantIdFromUrl } from "~/utils/services/.server/urlService";
|
||||
import { getUserInfo } from "~/utils/session.server";
|
||||
import { tenantHasModule } from "~/utils/connector/tenantConnector.server";
|
||||
import { getPermissionsByUser } from "~/utils/db/permissions/userRoles.db.server";
|
||||
import { BOOKING_MODULE_KEY } from "./bookingRoutePaths";
|
||||
|
||||
/** Booking atomic permissions, cumulative bundle (M06 Block K). */
|
||||
export const BOOKING_PERMISSIONS = {
|
||||
/** See your OWN appointments + edit your OWN availability (default capability). */
|
||||
readOwn: "bookings.read_own",
|
||||
/** See all tenant appointments / pages / availability. */
|
||||
readAll: "bookings.read_all",
|
||||
/** Manage appointments (held/no_show/cancel/reschedule). */
|
||||
write: "bookings.write",
|
||||
/** Booking-page CRUD, foreign availability, provider re-assign, hard-delete. */
|
||||
admin: "bookings.admin",
|
||||
} as const;
|
||||
|
||||
export type BookingRouteContext = {
|
||||
tenantId: string;
|
||||
userId: string;
|
||||
permissions: readonly string[];
|
||||
hasModule: boolean;
|
||||
};
|
||||
|
||||
/**
|
||||
* Resolve the booking route context: auth + tenant + the `booking` module gate +
|
||||
* the user's permissions. With `requireModule` a module-off tenant 404s (write
|
||||
* paths); GET paths can render a locked empty VM from `hasModule === false`.
|
||||
*/
|
||||
export async function loadBookingContext({
|
||||
request,
|
||||
params,
|
||||
requireModule = false,
|
||||
}: {
|
||||
request: Request;
|
||||
params: Record<string, string | undefined>;
|
||||
requireModule?: boolean;
|
||||
}): Promise<BookingRouteContext> {
|
||||
await requireAuth({ request, params });
|
||||
const [tenantId, userInfo] = await Promise.all([getTenantIdFromUrl(params), getUserInfo(request)]);
|
||||
if (!tenantId || !userInfo.userId) {
|
||||
throw new CatalogError(foundationErrors.notFound);
|
||||
}
|
||||
const [hasModule, permissions] = await Promise.all([
|
||||
tenantHasModule({ tenantId, userId: userInfo.userId, moduleKey: BOOKING_MODULE_KEY }),
|
||||
getPermissionsByUser(userInfo.userId, tenantId),
|
||||
]);
|
||||
if (requireModule && !hasModule) {
|
||||
throw new CatalogError(foundationErrors.notFound, { module: BOOKING_MODULE_KEY });
|
||||
}
|
||||
return { tenantId, userId: userInfo.userId, permissions, hasModule };
|
||||
}
|
||||
|
||||
/** True if the user holds `permission` or the broader `bookings.admin` bundle. */
|
||||
export function bookingHasPermission(ctx: BookingRouteContext, permission: string): boolean {
|
||||
return ctx.permissions.includes(permission) || ctx.permissions.includes(BOOKING_PERMISSIONS.admin);
|
||||
}
|
||||
|
||||
/** Require a bookings.* permission (admin-aware); 404 if missing (A.5.3). */
|
||||
export function requireBookingPermission(ctx: BookingRouteContext, permission: string): BookingRouteContext {
|
||||
if (!bookingHasPermission(ctx, permission)) {
|
||||
throw new CatalogError(foundationErrors.notFound, { permission });
|
||||
}
|
||||
return ctx;
|
||||
}
|
||||
|
||||
/** True if the user may see all appointments (read_all or admin), not just own. */
|
||||
export function canReadAllBookings(ctx: BookingRouteContext): boolean {
|
||||
return ctx.permissions.includes(BOOKING_PERMISSIONS.readAll) || ctx.permissions.includes(BOOKING_PERMISSIONS.admin);
|
||||
}
|
||||
|
||||
/**
|
||||
* Owner-check for appointment-scoped routes (M06 K.5): a `read_own` user may only
|
||||
* see/act on appointments they hold (`providerUserId = self`) — UNLESS they hold
|
||||
* read_all/admin. A miss is a 404, not a 403 (A.5.3).
|
||||
*/
|
||||
export function requireAppointmentOwner(ctx: BookingRouteContext, providerUserId: string): BookingRouteContext {
|
||||
if (ctx.userId === providerUserId || canReadAllBookings(ctx)) {
|
||||
return ctx;
|
||||
}
|
||||
throw new CatalogError(foundationErrors.notFound, { owner: "mismatch" });
|
||||
}
|
||||
+67
@@ -0,0 +1,67 @@
|
||||
// AK-P16b · pure client-safe route-path builders for the booking module. Loaders
|
||||
// build these and pass them into the VMs so the VMs stay routing-agnostic (mirrors
|
||||
// calendarRoutePaths). The module is feature-gated by its OWN `booking` key
|
||||
// (tenantHasModule) — unlike calendar which reuses `integrations`.
|
||||
|
||||
/** Tenant-connector module key for the Booking feature (M06 / DoD 7). */
|
||||
export const BOOKING_MODULE_KEY = "booking";
|
||||
|
||||
/** Reserved slugs that may not be used for a public booking page. */
|
||||
export const RESERVED_BOOKING_SLUGS: ReadonlySet<string> = new Set([
|
||||
"new",
|
||||
"pages",
|
||||
"embed",
|
||||
"admin",
|
||||
"api",
|
||||
"settings",
|
||||
]);
|
||||
|
||||
/** Appointments list (M06 Block C). */
|
||||
export function bookingsListPath(tenantSlug: string): string {
|
||||
return `/${tenantSlug}/bookings`;
|
||||
}
|
||||
|
||||
/** A single appointment's detail (M06 Block D). */
|
||||
export function bookingDetailPath(tenantSlug: string, appointmentId: string): string {
|
||||
return `/${tenantSlug}/bookings/${appointmentId}`;
|
||||
}
|
||||
|
||||
/** Booking-pages list (M06 Block E.1). */
|
||||
export function bookingPagesListPath(tenantSlug: string): string {
|
||||
return `/${tenantSlug}/bookings/pages`;
|
||||
}
|
||||
|
||||
/** New booking-page editor (M06 Block E.2). */
|
||||
export function bookingPageNewPath(tenantSlug: string): string {
|
||||
return `/${tenantSlug}/bookings/pages/new`;
|
||||
}
|
||||
|
||||
/** Edit an existing booking-page (M06 Block E.2). */
|
||||
export function bookingPageEditPath(tenantSlug: string, bookingPageId: string): string {
|
||||
return `/${tenantSlug}/bookings/pages/${bookingPageId}`;
|
||||
}
|
||||
|
||||
/** Per-user availability editor (M06 Block F). */
|
||||
export function availabilityPath(tenantSlug: string): string {
|
||||
return `/${tenantSlug}/availability`;
|
||||
}
|
||||
|
||||
/** Public booking page (M06 Block G). NOT tenant-login-scoped. */
|
||||
export function publicBookingPath(tenantSlug: string, slug: string): string {
|
||||
return `/b/${tenantSlug}/${slug}`;
|
||||
}
|
||||
|
||||
/** Iframe embed variant of the public booking page (M06 Block H). */
|
||||
export function publicBookingEmbedPath(tenantSlug: string, slug: string): string {
|
||||
return `/b/${tenantSlug}/${slug}/embed`;
|
||||
}
|
||||
|
||||
/** Absolute public URL (for the editor's copy-to-clipboard + iframe snippet). */
|
||||
export function publicBookingUrl(origin: string, tenantSlug: string, slug: string): string {
|
||||
return `${origin}${publicBookingPath(tenantSlug, slug)}`;
|
||||
}
|
||||
|
||||
/** 404 helper (Bauprinzip A.5.3 — permission/owner miss renders 404, not 403). */
|
||||
export function notFoundResponse(): Response {
|
||||
return new Response("Not Found", { status: 404 });
|
||||
}
|
||||
Reference in new issue
Block a user