feat: external lunch attendees card + dialog

Adds program.listFinalistProjects helper. Externals dialog supports
both standalone and project-attached entries; manifest's external row
edit-pencil opens this dialog via forwardRef.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Matt
2026-04-29 02:44:38 +02:00
parent 051dea4d0e
commit bbfe2d8097
4 changed files with 372 additions and 3 deletions

View File

@@ -153,7 +153,7 @@ export const lunchRouter = router({
roleNote: z.string().max(500).optional(),
dishId: z.string().nullable().optional(),
allergens: allergens.optional(),
allergenOther: z.string().max(500).optional(),
allergenOther: z.string().max(500).nullable().optional(),
}),
)
.mutation(async ({ ctx, input }) => {

View File

@@ -391,4 +391,21 @@ export const programRouter = router({
return { ok: true }
}),
/**
* List CONFIRMED finalist projects for a program — used by the lunch
* externals dialog to attach an external attendee to a team.
*/
listFinalistProjects: adminProcedure
.input(z.object({ programId: z.string() }))
.query(({ ctx, input }) =>
ctx.prisma.project.findMany({
where: {
programId: input.programId,
finalistConfirmation: { status: 'CONFIRMED' },
},
select: { id: true, title: true },
orderBy: { title: 'asc' },
}),
),
})