feat: show family assignment counts in notdienst planning dropdown and support editing unassigned days in published plans
This commit is contained in:
@@ -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,
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user