feat: show family assignment counts in notdienst planning dropdown and support editing unassigned days in published plans

This commit is contained in:
t.indorf
2026-05-21 14:29:13 +02:00
parent f6acb3d271
commit e9595fab21
9 changed files with 455 additions and 31 deletions
@@ -41,11 +41,13 @@ export default async function PlanungsZentralePage({
select: {
id: true,
status: true,
publishedAt: true,
assignments: {
select: {
id: true,
childId: true,
date: true,
createdAt: true,
},
},
},
@@ -111,6 +113,7 @@ export default async function PlanungsZentralePage({
id: true,
firstName: true,
lastName: true,
familyId: true,
family: {
select: {
name: true,
@@ -135,6 +138,7 @@ export default async function PlanungsZentralePage({
id: c.id,
name: `${c.firstName} ${c.lastName}`,
parentName,
familyId: c.familyId,
};
});
@@ -177,10 +181,15 @@ export default async function PlanungsZentralePage({
const assignment = plan?.assignments.find(
(a) => a.date.getTime() === day.getTime()
);
const isOriginallyUnassigned =
!assignment ||
(plan?.publishedAt && assignment.createdAt > plan.publishedAt);
return {
date: day.toISOString(),
assignmentId: assignment?.id || null,
childId: assignment?.childId || null,
isOriginallyUnassigned: !!isOriginallyUnassigned,
};
});