Add account hierarchy framework with migrations, RLS policies, and UI components

This commit is contained in:
T. Zehetbauer
2026-03-31 22:18:04 +02:00
parent 7e7da0b465
commit 59546ad6d2
262 changed files with 11671 additions and 3927 deletions

View File

@@ -1,18 +1,18 @@
import Link from 'next/link';
import { CalendarDays, ClipboardList, Users } from 'lucide-react';
import { getTranslations } from 'next-intl/server';
import { createEventManagementApi } from '@kit/event-management/api';
import { formatDate } from '@kit/shared/dates';
import { getSupabaseServerClient } from '@kit/supabase/server-client';
import { Badge } from '@kit/ui/badge';
import { Card, CardContent, CardHeader, CardTitle } from '@kit/ui/card';
import { createEventManagementApi } from '@kit/event-management/api';
import { AccountNotFound } from '~/components/account-not-found';
import { CmsPageShell } from '~/components/cms-page-shell';
import { EmptyState } from '~/components/empty-state';
import { StatsCard } from '~/components/stats-card';
import { AccountNotFound } from '~/components/account-not-found';
import { EVENT_STATUS_VARIANT, EVENT_STATUS_LABEL } from '~/lib/status-badges';
interface PageProps {
@@ -64,9 +64,7 @@ export default async function EventRegistrationsPage({ params }: PageProps) {
{/* Header */}
<div>
<h1 className="text-2xl font-bold">{t('registrations')}</h1>
<p className="text-muted-foreground">
{t('registrationsOverview')}
</p>
<p className="text-muted-foreground">{t('registrationsOverview')}</p>
</div>
{/* Stats */}
@@ -108,17 +106,25 @@ export default async function EventRegistrationsPage({ params }: PageProps) {
<div className="rounded-md border">
<table className="w-full text-sm">
<thead>
<tr className="border-b bg-muted/50">
<tr className="bg-muted/50 border-b">
<th className="p-3 text-left font-medium">
{t('event')}
</th>
<th className="p-3 text-left font-medium">{t('eventDate')}</th>
<th className="p-3 text-left font-medium">{t('status')}</th>
<th className="p-3 text-right font-medium">{t('capacity')}</th>
<th className="p-3 text-left font-medium">
{t('eventDate')}
</th>
<th className="p-3 text-left font-medium">
{t('status')}
</th>
<th className="p-3 text-right font-medium">
{t('capacity')}
</th>
<th className="p-3 text-right font-medium">
{t('registrations')}
</th>
<th className="p-3 text-right font-medium">{t('utilization')}</th>
<th className="p-3 text-right font-medium">
{t('utilization')}
</th>
</tr>
</thead>
<tbody>
@@ -133,7 +139,7 @@ export default async function EventRegistrationsPage({ params }: PageProps) {
return (
<tr
key={event.id}
className="border-b hover:bg-muted/30"
className="hover:bg-muted/30 border-b"
>
<td className="p-3 font-medium">
<Link
@@ -143,17 +149,12 @@ export default async function EventRegistrationsPage({ params }: PageProps) {
{event.name}
</Link>
</td>
<td className="p-3">
{event.eventDate
? new Date(event.eventDate).toLocaleDateString(
'de-DE',
)
: '—'}
</td>
<td className="p-3">{formatDate(event.eventDate)}</td>
<td className="p-3">
<Badge
variant={
EVENT_STATUS_VARIANT[event.status] ?? 'secondary'
EVENT_STATUS_VARIANT[event.status] ??
'secondary'
}
>
{EVENT_STATUS_LABEL[event.status] ?? event.status}