feat add questions module and admin routes

This commit is contained in:
2026-06-15 07:34:41 +03:30
parent d1fecf62ad
commit 0eea63fec1
28 changed files with 636 additions and 23 deletions
@@ -3,6 +3,7 @@ import {
Column,
CreateDateColumn,
Entity,
Index,
ManyToOne,
OneToMany,
PrimaryGeneratedColumn,
@@ -10,8 +11,10 @@ import {
import { QuestionType } from '../enums/question-type.enum';
import type { QuestionMetadata } from '../types/question-metadata.type';
import { Choice } from './choice.entity';
import { UNIQUE_TEST_ORDER_IDX } from '../constants';
@Entity()
@Index(UNIQUE_TEST_ORDER_IDX, ['test', 'order'], { unique: true })
export class Question {
@PrimaryGeneratedColumn()
id!: number;
@@ -28,7 +31,7 @@ export class Question {
})
type!: QuestionType;
@Column({ type: 'text' })
@Column({ type: 'text', nullable: false })
content!: string;
@Column({ type: 'int', nullable: false })