import type { LegacyEventRedirectLookup } from '@/lib/seo/serverApi' import { CONSUMER_ROUTES, SEO_ROUTES } from '@/constants/routes' const CANONICAL_EVENT_STATUSES = new Set(['published', 'full', 'completed']) export function resolveLegacyEventDestination(event: LegacyEventRedirectLookup): string | null { if (!event.slug) return null if (event.settings?.isDiscoverable === false) return null if (!CANONICAL_EVENT_STATUSES.has(event.status)) return null return SEO_ROUTES.EVENT_LANDING(event.slug) } /** Public event detail href: canonical slug when available, otherwise private UUID route. */ export function resolveEventDetailHref(event: LegacyEventRedirectLookup): string { return resolveLegacyEventDestination(event) ?? CONSUMER_ROUTES.EVENT_DETAIL(event.id) }