import { notFound } from "next/navigation";
import type { KolaboraEvent } from "@/types/event";

/**
 * Keeps `/admin/signature/events/[id]/*` scoped to actual Signature Events —
 * an admin cannot reach a regular event's management pages just by guessing
 * its id under the Signature URL tree. A Signature Event is any event with a
 * related `signature_profile` row (no dedicated column), same rule as the
 * backend's `signature` list filter on `GET /admin/events`
 * (Admin\EventController::index()`). Deliberately NOT the same thing as
 * `is_signature_event` (that field tracks the separate, narrower "Kolabora
 * Official showcase" concept behind the legacy `/admin/signature` settings
 * page — see that filter's comment for how the two relate).
 */
export function ensureSignatureEvent(event: KolaboraEvent): void {
  if (!event.signature_profile) {
    notFound();
  }
}
