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:
@@ -410,7 +410,7 @@ export const mentorRouter = router({
|
||||
// Get projects without mentors
|
||||
const projects = await ctx.prisma.project.findMany({
|
||||
where: {
|
||||
roundProjects: { some: { roundId: input.roundId } },
|
||||
roundId: input.roundId,
|
||||
mentorAssignment: null,
|
||||
wantsMentorship: true,
|
||||
},
|
||||
@@ -549,17 +549,10 @@ export const mentorRouter = router({
|
||||
include: {
|
||||
project: {
|
||||
include: {
|
||||
program: { select: { name: true, year: true } },
|
||||
roundProjects: {
|
||||
round: {
|
||||
include: {
|
||||
round: {
|
||||
include: {
|
||||
program: { select: { name: true, year: true } },
|
||||
},
|
||||
},
|
||||
program: { select: { name: true, year: true } },
|
||||
},
|
||||
orderBy: { addedAt: 'desc' },
|
||||
take: 1,
|
||||
},
|
||||
teamMembers: {
|
||||
include: {
|
||||
@@ -602,17 +595,10 @@ export const mentorRouter = router({
|
||||
const project = await ctx.prisma.project.findUniqueOrThrow({
|
||||
where: { id: input.projectId },
|
||||
include: {
|
||||
program: { select: { id: true, name: true, year: true } },
|
||||
roundProjects: {
|
||||
round: {
|
||||
include: {
|
||||
round: {
|
||||
include: {
|
||||
program: { select: { id: true, name: true, year: true } },
|
||||
},
|
||||
},
|
||||
program: { select: { id: true, name: true, year: true } },
|
||||
},
|
||||
orderBy: { addedAt: 'desc' },
|
||||
take: 1,
|
||||
},
|
||||
teamMembers: {
|
||||
include: {
|
||||
@@ -660,7 +646,7 @@ export const mentorRouter = router({
|
||||
)
|
||||
.query(async ({ ctx, input }) => {
|
||||
const where = {
|
||||
...(input.roundId && { project: { roundProjects: { some: { roundId: input.roundId } } } }),
|
||||
...(input.roundId && { project: { roundId: input.roundId } }),
|
||||
...(input.mentorId && { mentorId: input.mentorId }),
|
||||
}
|
||||
|
||||
@@ -675,10 +661,7 @@ export const mentorRouter = router({
|
||||
teamName: true,
|
||||
oceanIssue: true,
|
||||
competitionCategory: true,
|
||||
roundProjects: {
|
||||
select: { status: true },
|
||||
take: 1,
|
||||
},
|
||||
status: true,
|
||||
},
|
||||
},
|
||||
mentor: {
|
||||
|
||||
Reference in New Issue
Block a user