feat: enhance QuizSchema and related schemas with new fields and relations

- Updated QuizSchema to expose correctAnswer as a field with a resolver, improving data retrieval for quizzes.
- Introduced new object types for correctAnswer, allowing for flexible data structures (StringType and StringListType).
- Modified createQuiz mutation to automatically associate the current user as centerMentorId, enhancing data integrity.
- Added personalMilestone relation to ScheduleSchema, linking schedules to personal milestones for better tracking.
- Included quiz relation in ServiceSchema, establishing a connection between services and their associated quizzes.
- Updated Prisma types to reflect the new relationships and fields, ensuring consistency across the application.
This commit is contained in:
2024-12-07 18:18:33 +07:00
parent d59df7d2ab
commit bb88d6ed00
7 changed files with 159 additions and 5 deletions

View File

@@ -68,6 +68,10 @@ export class ScheduleSchema extends PothosSchema {
description: 'The managed service the schedule belongs to.',
nullable: false,
}),
personalMilestone: t.relation('personalMilestone', {
description: 'The personal milestone of the schedule.',
nullable: true,
}),
}),
})
}