39 lines
653 B
TypeScript
39 lines
653 B
TypeScript
import { Test } from '@/modules/tests/entities/test.entity';
|
|
import { Column, Entity, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
|
|
|
|
@Entity()
|
|
export class ResultRange {
|
|
@PrimaryGeneratedColumn()
|
|
id!: number;
|
|
|
|
@ManyToOne(() => Test, (test) => test.resultRanges, {
|
|
onDelete: 'CASCADE',
|
|
})
|
|
test!: Test;
|
|
|
|
@Column({
|
|
type: 'int',
|
|
nullable: false,
|
|
})
|
|
minScore!: number;
|
|
|
|
@Column({
|
|
type: 'int',
|
|
nullable: false,
|
|
})
|
|
maxScore!: number;
|
|
|
|
@Column({
|
|
type: 'varchar',
|
|
length: 255,
|
|
nullable: false,
|
|
})
|
|
title!: string;
|
|
|
|
@Column({
|
|
type: 'text',
|
|
nullable: false,
|
|
})
|
|
description!: string;
|
|
}
|