Remove dynamic form builder and complete RoundProject→roundId migration

Major cleanup and schema migration:
- Remove unused dynamic form builder system (ApplicationForm, ApplicationFormField, etc.)
- Complete migration from RoundProject junction table to direct Project.roundId
- Add sortOrder and entryNotificationType fields to Round model
- Add country field to User model for mentor matching
- Enhance onboarding with profile photo and country selection steps
- Fix all TypeScript errors related to roundProjects references
- Remove unused libraries (@radix-ui/react-toast, embla-carousel-react, vaul)

Files removed:
- admin/forms/* pages and related components
- admin/onboarding/* pages
- applicationForm.ts and onboarding.ts routers
- Dynamic form builder Prisma models and enums

Schema changes:
- Removed ApplicationForm, ApplicationFormField, OnboardingStep, ApplicationFormSubmission, SubmissionFile models
- Removed FormFieldType and SpecialFieldType enums
- Added Round.sortOrder, Round.entryNotificationType
- Added User.country

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-02-04 14:15:06 +01:00
parent 7bcd2ce6ca
commit 29827268b2
71 changed files with 2139 additions and 6609 deletions

View File

@@ -359,7 +359,7 @@ export default function ProjectsPage() {
</TableHeader>
<TableBody>
{data.projects.map((project) => {
const isEliminated = project.roundProjects?.[0]?.status === 'REJECTED'
const isEliminated = project.status === 'REJECTED'
return (
<TableRow
key={project.id}
@@ -388,15 +388,15 @@ export default function ProjectsPage() {
<TableCell>
<div>
<div className="flex items-center gap-2">
<p>{project.roundProjects?.[0]?.round?.name ?? '-'}</p>
{project.roundProjects?.[0]?.status === 'REJECTED' && (
<p>{project.round?.name ?? '-'}</p>
{project.status === 'REJECTED' && (
<Badge variant="destructive" className="text-xs">
Eliminated
</Badge>
)}
</div>
<p className="text-sm text-muted-foreground">
{project.program?.name}
{project.round?.program?.name}
</p>
</div>
</TableCell>
@@ -409,9 +409,9 @@ export default function ProjectsPage() {
</TableCell>
<TableCell>
<Badge
variant={statusColors[project.roundProjects?.[0]?.status ?? 'SUBMITTED'] || 'secondary'}
variant={statusColors[project.status ?? 'SUBMITTED'] || 'secondary'}
>
{(project.roundProjects?.[0]?.status ?? 'SUBMITTED').replace('_', ' ')}
{(project.status ?? 'SUBMITTED').replace('_', ' ')}
</Badge>
</TableCell>
<TableCell className="relative z-10 text-right">
@@ -478,11 +478,11 @@ export default function ProjectsPage() {
</CardTitle>
<Badge
variant={
statusColors[project.roundProjects?.[0]?.status ?? 'SUBMITTED'] || 'secondary'
statusColors[project.status ?? 'SUBMITTED'] || 'secondary'
}
className="shrink-0"
>
{(project.roundProjects?.[0]?.status ?? 'SUBMITTED').replace('_', ' ')}
{(project.status ?? 'SUBMITTED').replace('_', ' ')}
</Badge>
</div>
<CardDescription>{project.teamName}</CardDescription>
@@ -493,8 +493,8 @@ export default function ProjectsPage() {
<div className="flex items-center justify-between text-sm">
<span className="text-muted-foreground">Round</span>
<div className="flex items-center gap-2">
<span>{project.roundProjects?.[0]?.round?.name ?? '-'}</span>
{project.roundProjects?.[0]?.status === 'REJECTED' && (
<span>{project.round?.name ?? '-'}</span>
{project.status === 'REJECTED' && (
<Badge variant="destructive" className="text-xs">
Eliminated
</Badge>