feat: complete notdienst planning, quick wins and notifications

This commit is contained in:
t.indorf
2026-10-12 15:34:09 +02:00
parent b915857951
commit 00f602a7aa
50 changed files with 2443 additions and 513 deletions
+7 -3
View File
@@ -5,7 +5,8 @@ import { Manrope } from "next/font/google";
import { requireRole } from "@/lib/auth-utils";
import { prisma } from "@/lib/prisma";
import { formatDateKey, getTargetMonthData } from "@/lib/date-utils";
import { formatUtcDateKey, getTargetMonthData } from "@/lib/date-utils";
import { getNotdienstDays } from "@/lib/notdienst-days";
import { Button } from "@/components/ui/button";
import { NotdienstEntry } from "./notdienst-entry";
@@ -77,7 +78,7 @@ export default async function NotdienstPage() {
kitaId,
status: TerminStatus.CONFIRMED,
startDate: { lt: targetMonthEnd },
endDate: { gte: targetMonthStart },
endDate: { gte: new Date(targetMonthStart.getTime() - 86400000) },
},
select: {
id: true,
@@ -93,7 +94,10 @@ export default async function NotdienstPage() {
])
: [[], []];
const selectedDates = availabilities.map((a) => formatDateKey(a.date));
const validDateKeys = new Set(getNotdienstDays(targetYear, targetMonth,
termine.filter((termin) => termin.type === TerminType.SCHLIESSTAG || termin.type === TerminType.TEAMTAG),
).map(formatUtcDateKey));
const selectedDates = availabilities.map((a) => formatUtcDateKey(a.date)).filter((key) => validDateKeys.has(key));
return (
<div className={`${manrope.className} mx-auto max-w-7xl px-4 py-8 sm:px-8`}>