feat: add admin tests read and update endpoints

This commit is contained in:
2026-06-06 13:33:56 +03:30
parent 39e6c96113
commit 28c1a4831e
31 changed files with 330 additions and 101 deletions
@@ -14,35 +14,35 @@ import { Choice } from './choice.entity';
@Entity()
export class Question {
@PrimaryGeneratedColumn()
id: number;
id!: number;
@ManyToOne(() => Test, (test) => test.questions, {
onDelete: 'CASCADE',
})
test: Test;
test!: Test;
@Column({
type: 'enum',
enum: QuestionType,
default: QuestionType.MULTI_CHOICE,
})
type: QuestionType;
type!: QuestionType;
@Column({ type: 'text' })
content: string;
content!: string;
@Column({ type: 'int', nullable: false })
order: number;
order!: number;
@Column({ type: 'boolean', default: true })
required: boolean;
required!: boolean;
@Column({ type: 'jsonb', nullable: true })
metadata: QuestionMetadata;
metadata!: QuestionMetadata;
@OneToMany(() => Choice, (choice) => choice.question)
choices?: Array<Choice>;
@CreateDateColumn()
createdAt: Date;
createdAt!: Date;
}