feat: pre-existing local changes — fischerei, verband, modules, members, packages
Some checks failed
Workflow / ʦ TypeScript (push) Failing after 6m20s
Workflow / ⚫️ Test (push) Has been skipped

Commits all remaining uncommitted local work:

- apps/web: fischerei, verband, modules, members-cms, documents,
  newsletter, meetings, site-builder, courses, bookings, events,
  finance pages and components
- apps/web: marketing page updates, layout, paths config,
  next.config.mjs, styles/makerkit.css
- apps/web/i18n: documents, fischerei, marketing, verband (de+en)
- packages/features: finance, fischerei, member-management,
  module-builder, newsletter, sitzungsprotokolle, verbandsverwaltung
  server APIs and components
- packages/ui: button.tsx updates
- pnpm-lock.yaml
This commit is contained in:
Zaid Marzguioui
2026-04-02 01:19:54 +02:00
parent a1719671df
commit b26e5aaafa
153 changed files with 2329 additions and 1227 deletions

View File

@@ -1,6 +1,7 @@
import { createMemberManagementApi } from '@kit/member-management/api';
import { EditMemberForm } from '@kit/member-management/components';
import { getSupabaseServerClient } from '@kit/supabase/server-client';
import { getTranslations } from 'next-intl/server';
import { AccountNotFound } from '~/components/account-not-found';
import { CmsPageShell } from '~/components/cms-page-shell';
@@ -11,6 +12,7 @@ interface Props {
export default async function EditMemberPage({ params }: Props) {
const { account, memberId } = await params;
const t = await getTranslations('members');
const client = getSupabaseServerClient();
const { data: acct } = await client
.from('accounts')
@@ -21,12 +23,12 @@ export default async function EditMemberPage({ params }: Props) {
const api = createMemberManagementApi(client);
const member = await api.getMember(memberId);
if (!member) return <div>Mitglied nicht gefunden</div>;
if (!member) return <div>{t('detail.notFound')}</div>;
return (
<CmsPageShell
account={account}
title={`${String(member.first_name)} ${String(member.last_name)} bearbeiten`}
title={`${String(member.first_name)} ${String(member.last_name)} ${t('form.editTitle')}`}
>
<EditMemberForm member={member} account={account} accountId={acct.id} />
</CmsPageShell>

View File

@@ -21,7 +21,7 @@ export default async function MemberDetailPage({ params }: Props) {
const api = createMemberManagementApi(client);
const member = await api.getMember(memberId);
if (!member) return <div>Mitglied nicht gefunden</div>;
if (!member) return <AccountNotFound />;
// Fetch sub-entities in parallel
const [roles, honors, mandates] = await Promise.all([

View File

@@ -1,3 +1,5 @@
import { getTranslations } from 'next-intl/server';
import { createMemberManagementApi } from '@kit/member-management/api';
import { ApplicationWorkflow } from '@kit/member-management/components';
import { getSupabaseServerClient } from '@kit/supabase/server-client';
@@ -12,6 +14,7 @@ interface Props {
export default async function ApplicationsPage({ params }: Props) {
const { account } = await params;
const client = getSupabaseServerClient();
const t = await getTranslations('members');
const { data: acct } = await client
.from('accounts')
.select('id')
@@ -25,8 +28,8 @@ export default async function ApplicationsPage({ params }: Props) {
return (
<CmsPageShell
account={account}
title="Aufnahmeanträge"
description="Mitgliedsanträge bearbeiten"
title={t('nav.applications')}
description={t('applications.subtitle')}
>
<ApplicationWorkflow
applications={applications}

View File

@@ -1,4 +1,5 @@
import { CreditCard } from 'lucide-react';
import { getTranslations } from 'next-intl/server';
import { createMemberManagementApi } from '@kit/member-management/api';
import { getSupabaseServerClient } from '@kit/supabase/server-client';
@@ -17,6 +18,7 @@ interface Props {
export default async function MemberCardsPage({ params }: Props) {
const { account } = await params;
const client = getSupabaseServerClient();
const t = await getTranslations('members');
const { data: acct } = await client
.from('accounts')
.select('id')
@@ -34,23 +36,23 @@ export default async function MemberCardsPage({ params }: Props) {
return (
<CmsPageShell
account={account}
title="Mitgliedsausweise"
description="Ausweise erstellen und verwalten"
title={t('cards.title')}
description={t('cards.subtitle')}
>
{members.length === 0 ? (
<EmptyState
icon={<CreditCard className="h-8 w-8" />}
title="Keine aktiven Mitglieder"
description="Erstellen Sie zuerst Mitglieder, um Ausweise zu generieren."
actionLabel="Mitglieder verwalten"
title={t('cards.noMembers')}
description={t('cards.noMembersDesc')}
actionLabel={t('nav.members')}
actionHref={`/home/${account}/members-cms`}
/>
) : (
<EmptyState
icon={<CreditCard className="h-8 w-8" />}
title="Feature in Entwicklung"
description={`Die Ausweiserstellung für ${members.length} aktive Mitglieder wird derzeit entwickelt. Diese Funktion wird in einem kommenden Update verfügbar sein.`}
actionLabel="Mitglieder verwalten"
title={t('cards.inDevelopment')}
description={t('cards.inDevelopmentDesc', { count: result.total })}
actionLabel={t('nav.members')}
actionHref={`/home/${account}/members-cms`}
/>
)}

View File

@@ -5,6 +5,7 @@ import { useCallback, useState } from 'react';
import { useRouter } from 'next/navigation';
import { Plus } from 'lucide-react';
import { useTranslations } from 'next-intl';
import { createDepartment } from '@kit/member-management/actions/member-actions';
import { Button } from '@kit/ui/button';
@@ -28,14 +29,15 @@ interface CreateDepartmentDialogProps {
export function CreateDepartmentDialog({
accountId,
}: CreateDepartmentDialogProps) {
const t = useTranslations('members.departments');
const router = useRouter();
const [open, setOpen] = useState(false);
const [name, setName] = useState('');
const [description, setDescription] = useState('');
const { execute, isPending } = useActionWithToast(createDepartment, {
successMessage: 'Abteilung erstellt',
errorMessage: 'Fehler beim Erstellen der Abteilung',
successMessage: t('created'),
errorMessage: t('createError'),
onSuccess: () => {
setOpen(false);
setName('');
@@ -61,42 +63,42 @@ export function CreateDepartmentDialog({
<Dialog open={open} onOpenChange={setOpen}>
<DialogTrigger render={<Button size="sm" />}>
<Plus className="mr-1 h-4 w-4" />
Neue Abteilung
{t('newDepartment')}
</DialogTrigger>
<DialogContent>
<form onSubmit={handleSubmit}>
<DialogHeader>
<DialogTitle>Neue Abteilung</DialogTitle>
<DialogTitle>{t('newDepartment')}</DialogTitle>
<DialogDescription>
Erstellen Sie eine neue Abteilung oder Sparte für Ihren Verein.
{t('createDialogDescription')}
</DialogDescription>
</DialogHeader>
<div className="mt-4 space-y-4">
<div className="space-y-2">
<Label htmlFor="dept-name">Name</Label>
<Label htmlFor="dept-name">{t('name')}</Label>
<Input
id="dept-name"
value={name}
onChange={(e) => setName(e.target.value)}
placeholder="z. B. Jugendabteilung"
placeholder={t('namePlaceholder')}
required
minLength={1}
maxLength={128}
/>
</div>
<div className="space-y-2">
<Label htmlFor="dept-description">Beschreibung (optional)</Label>
<Label htmlFor="dept-description">{t('descriptionLabel')}</Label>
<Input
id="dept-description"
value={description}
onChange={(e) => setDescription(e.target.value)}
placeholder="Kurze Beschreibung"
placeholder={t('descriptionPlaceholder')}
/>
</div>
</div>
<DialogFooter className="mt-4">
<Button type="submit" disabled={isPending || !name.trim()}>
{isPending ? 'Wird erstellt…' : 'Erstellen'}
{isPending ? t('creating') : t('create')}
</Button>
</DialogFooter>
</form>

View File

@@ -0,0 +1,93 @@
'use client';
import { useTransition } from 'react';
import { useRouter } from 'next/navigation';
import { Trash2 } from 'lucide-react';
import { useTranslations } from 'next-intl';
import {
AlertDialog,
AlertDialogAction,
AlertDialogCancel,
AlertDialogContent,
AlertDialogDescription,
AlertDialogFooter,
AlertDialogHeader,
AlertDialogTitle,
AlertDialogTrigger,
} from '@kit/ui/alert-dialog';
import { Button } from '@kit/ui/button';
interface DeleteDepartmentButtonProps {
departmentId: string;
departmentName: string;
accountId: string;
}
export function DeleteDepartmentButton({
departmentId,
departmentName,
accountId,
}: DeleteDepartmentButtonProps) {
const t = useTranslations('members.departments');
const router = useRouter();
const [isPending, startTransition] = useTransition();
const handleDelete = () => {
startTransition(async () => {
try {
const response = await fetch(
`/api/members/departments/${departmentId}`,
{
method: 'DELETE',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ accountId }),
},
);
if (response.ok) {
router.refresh();
}
} catch (error) {
console.error('Failed to delete department:', error);
}
});
};
return (
<AlertDialog>
<AlertDialogTrigger
render={
<Button
variant="ghost"
size="sm"
className="text-destructive hover:text-destructive"
disabled={isPending}
>
<Trash2 className="h-4 w-4" aria-hidden="true" />
<span className="sr-only">{t('deleteAria')}</span>
</Button>
}
/>
<AlertDialogContent>
<AlertDialogHeader>
<AlertDialogTitle>{t('deleteTitle')}</AlertDialogTitle>
<AlertDialogDescription>
{t('deleteConfirm', { name: departmentName })}
</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
<AlertDialogCancel>{t('cancel')}</AlertDialogCancel>
<AlertDialogAction
onClick={handleDelete}
className="bg-destructive text-destructive-foreground hover:bg-destructive/90"
>
{t('delete')}
</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialog>
);
}

View File

@@ -1,4 +1,5 @@
import { Users } from 'lucide-react';
import { getTranslations } from 'next-intl/server';
import { createMemberManagementApi } from '@kit/member-management/api';
import { getSupabaseServerClient } from '@kit/supabase/server-client';
@@ -8,6 +9,7 @@ import { CmsPageShell } from '~/components/cms-page-shell';
import { EmptyState } from '~/components/empty-state';
import { CreateDepartmentDialog } from './create-department-dialog';
import { DeleteDepartmentButton } from './delete-department-button';
interface Props {
params: Promise<{ account: string }>;
@@ -16,6 +18,7 @@ interface Props {
export default async function DepartmentsPage({ params }: Props) {
const { account } = await params;
const client = getSupabaseServerClient();
const t = await getTranslations('members');
const { data: acct } = await client
.from('accounts')
.select('id')
@@ -29,8 +32,8 @@ export default async function DepartmentsPage({ params }: Props) {
return (
<CmsPageShell
account={account}
title="Abteilungen"
description="Sparten und Abteilungen verwalten"
title={t('departments.title')}
description={t('departments.subtitle')}
>
<div className="space-y-4">
<div className="flex items-center justify-end">
@@ -40,16 +43,23 @@ export default async function DepartmentsPage({ params }: Props) {
{departments.length === 0 ? (
<EmptyState
icon={<Users className="h-8 w-8" />}
title="Keine Abteilungen vorhanden"
description="Erstellen Sie Ihre erste Abteilung."
title={t('departments.noDepartments')}
description={t('departments.createFirst')}
/>
) : (
<div className="rounded-md border">
<table className="w-full text-sm">
<div className="overflow-x-auto rounded-md border">
<table className="w-full min-w-[640px] text-sm">
<thead>
<tr className="bg-muted/50 border-b">
<th className="p-3 text-left font-medium">Name</th>
<th className="p-3 text-left font-medium">Beschreibung</th>
<th scope="col" className="p-3 text-left font-medium">
{t('departments.name')}
</th>
<th scope="col" className="p-3 text-left font-medium">
{t('departments.description')}
</th>
<th scope="col" className="p-3 text-left font-medium">
{t('departments.actions')}
</th>
</tr>
</thead>
<tbody>
@@ -62,6 +72,15 @@ export default async function DepartmentsPage({ params }: Props) {
<td className="text-muted-foreground p-3">
{String(dept.description ?? '—')}
</td>
<td className="p-3">
<div className="flex items-center gap-2">
<DeleteDepartmentButton
departmentId={String(dept.id)}
departmentName={String(dept.name)}
accountId={acct.id}
/>
</div>
</td>
</tr>
))}
</tbody>

View File

@@ -1,3 +1,5 @@
import { getTranslations } from 'next-intl/server';
import { createMemberManagementApi } from '@kit/member-management/api';
import { DuesCategoryManager } from '@kit/member-management/components';
import { getSupabaseServerClient } from '@kit/supabase/server-client';
@@ -11,6 +13,7 @@ interface Props {
export default async function DuesPage({ params }: Props) {
const { account } = await params;
const t = await getTranslations('members');
const client = getSupabaseServerClient();
const { data: acct } = await client
.from('accounts')
@@ -25,8 +28,8 @@ export default async function DuesPage({ params }: Props) {
return (
<CmsPageShell
account={account}
title="Beitragskategorien"
description="Mitgliedsbeiträge verwalten"
title={t('dues.title')}
description={t('dues.subtitle')}
>
<DuesCategoryManager categories={categories} accountId={acct.id} />
</CmsPageShell>

View File

@@ -1,3 +1,5 @@
import { getTranslations } from 'next-intl/server';
import { MemberImportWizard } from '@kit/member-management/components';
import { getSupabaseServerClient } from '@kit/supabase/server-client';
@@ -11,6 +13,7 @@ interface Props {
export default async function MemberImportPage({ params }: Props) {
const { account } = await params;
const client = getSupabaseServerClient();
const t = await getTranslations('members');
const { data: acct } = await client
.from('accounts')
.select('id')
@@ -21,8 +24,8 @@ export default async function MemberImportPage({ params }: Props) {
return (
<CmsPageShell
account={account}
title="Mitglieder importieren"
description="CSV-Datei importieren"
title={t('import.title')}
description={t('import.subtitle')}
>
<MemberImportWizard accountId={acct.id} account={account} />
</CmsPageShell>

View File

@@ -1,3 +1,5 @@
import { getTranslations } from 'next-intl/server';
import { createMemberManagementApi } from '@kit/member-management/api';
import { getSupabaseServerClient } from '@kit/supabase/server-client';
@@ -13,6 +15,7 @@ interface Props {
export default async function InvitationsPage({ params }: Props) {
const { account } = await params;
const client = getSupabaseServerClient();
const t = await getTranslations('members');
const { data: acct } = await client
.from('accounts')
.select('id')
@@ -34,8 +37,8 @@ export default async function InvitationsPage({ params }: Props) {
return (
<CmsPageShell
account={account}
title="Portal-Einladungen"
description="Einladungen zum Mitgliederportal verwalten"
title={t('invitations.title')}
description={t('invitations.subtitle')}
>
<InvitationsView
invitations={invitations}

View File

@@ -1,3 +1,5 @@
import { getTranslations } from 'next-intl/server';
import { createMemberManagementApi } from '@kit/member-management/api';
import { CreateMemberForm } from '@kit/member-management/components';
import { getSupabaseServerClient } from '@kit/supabase/server-client';
@@ -11,6 +13,7 @@ interface Props {
export default async function NewMemberPage({ params }: Props) {
const { account } = await params;
const t = await getTranslations('members');
const client = getSupabaseServerClient();
const { data: acct } = await client
.from('accounts')
@@ -25,8 +28,8 @@ export default async function NewMemberPage({ params }: Props) {
return (
<CmsPageShell
account={account}
title="Neues Mitglied"
description="Mitglied manuell anlegen"
title={t('form.newMemberTitle')}
description={t('form.newMemberDescription')}
>
<CreateMemberForm
accountId={acct.id}

View File

@@ -1,3 +1,5 @@
import { getTranslations } from 'next-intl/server';
import { createMemberManagementApi } from '@kit/member-management/api';
import { MembersDataTable } from '@kit/member-management/components';
import { getSupabaseServerClient } from '@kit/supabase/server-client';
@@ -16,6 +18,7 @@ export default async function MembersPage({ params, searchParams }: Props) {
const { account } = await params;
const search = await searchParams;
const client = getSupabaseServerClient();
const t = await getTranslations('members');
const { data: acct } = await client
.from('accounts')
.select('id')
@@ -36,8 +39,8 @@ export default async function MembersPage({ params, searchParams }: Props) {
return (
<CmsPageShell
account={account}
title="Mitglieder"
description={`${result.total} Mitglieder`}
title={t('nav.members')}
description={`${result.total} ${t('nav.members')}`}
>
<MembersDataTable
data={result.data}

View File

@@ -6,6 +6,7 @@ import {
BarChart3,
TrendingUp,
} from 'lucide-react';
import { getTranslations } from 'next-intl/server';
import { createMemberManagementApi } from '@kit/member-management/api';
import { getSupabaseServerClient } from '@kit/supabase/server-client';
@@ -23,6 +24,7 @@ interface PageProps {
export default async function MemberStatisticsPage({ params }: PageProps) {
const { account } = await params;
const client = getSupabaseServerClient();
const t = await getTranslations('members');
const { data: acct } = await client
.from('accounts')
@@ -36,33 +38,33 @@ export default async function MemberStatisticsPage({ params }: PageProps) {
const stats = await api.getMemberStatistics(acct.id);
const statusChartData = [
{ name: 'Aktiv', value: stats.active ?? 0 },
{ name: 'Inaktiv', value: stats.inactive ?? 0 },
{ name: 'Ausstehend', value: stats.pending ?? 0 },
{ name: 'Ausgetreten', value: stats.resigned ?? 0 },
{ name: t('status.active'), value: stats.active ?? 0 },
{ name: t('status.inactive'), value: stats.inactive ?? 0 },
{ name: t('status.pending'), value: stats.pending ?? 0 },
{ name: t('status.resigned'), value: stats.resigned ?? 0 },
];
return (
<CmsPageShell account={account} title="Mitglieder-Statistiken">
<CmsPageShell account={account} title={t('statistics.title')}>
<div className="flex w-full flex-col gap-6">
<div className="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4">
<StatsCard
title="Gesamt"
title={t('statistics.totalMembers')}
value={stats.total ?? 0}
icon={<Users className="h-5 w-5" />}
/>
<StatsCard
title="Aktiv"
title={t('status.active')}
value={stats.active ?? 0}
icon={<UserCheck className="h-5 w-5" />}
/>
<StatsCard
title="Inaktiv"
title={t('status.inactive')}
value={stats.inactive ?? 0}
icon={<UserMinus className="h-5 w-5" />}
/>
<StatsCard
title="Ausstehend"
title={t('status.pending')}
value={stats.pending ?? 0}
icon={<Clock className="h-5 w-5" />}
/>
@@ -73,7 +75,7 @@ export default async function MemberStatisticsPage({ params }: PageProps) {
<CardHeader>
<CardTitle className="flex items-center gap-2">
<BarChart3 className="h-5 w-5" />
Mitglieder nach Status
{t('statistics.title')}
</CardTitle>
</CardHeader>
<CardContent>
@@ -85,7 +87,7 @@ export default async function MemberStatisticsPage({ params }: PageProps) {
<CardHeader>
<CardTitle className="flex items-center gap-2">
<TrendingUp className="h-5 w-5" />
Verteilung
{t('statistics.totalMembers')}
</CardTitle>
</CardHeader>
<CardContent>