57 lines
1.5 KiB
TypeScript
57 lines
1.5 KiB
TypeScript
import { Table, Column, Model, Default, DataType, ForeignKey } from 'sequelize-typescript';
|
|
import { ApiProperty } from '@nestjs/swagger';
|
|
import Question from 'src/question/question.entity';
|
|
import Test from 'src/test/test.entity';
|
|
|
|
@Table({ tableName: 'test_question_rel', paranoid: true })
|
|
export default class TestQuestionRel extends Model {
|
|
|
|
@ApiProperty({ type: Number })
|
|
@ForeignKey(() => Test)
|
|
@Column(DataType.BIGINT)
|
|
testId: number;
|
|
|
|
@ApiProperty({ type: Number })
|
|
@ForeignKey(() => Question)
|
|
@Column(DataType.BIGINT)
|
|
questionId: number;
|
|
|
|
@ApiProperty({ type: Date, default: new Date() })
|
|
@Default(new Date())
|
|
@Column(DataType.DATEONLY)
|
|
validFrom: Date;
|
|
|
|
@ApiProperty({ type: Date, default: new Date("2070-12-31") })
|
|
@Default(new Date("2070-12-31"))
|
|
@Column(DataType.DATEONLY)
|
|
validTill: Date;
|
|
|
|
@ApiProperty({ type: String, format: 'date-time' })
|
|
@Column(DataType.DATE)
|
|
createdAt: Date;
|
|
|
|
@ApiProperty({ type: String, format: 'date-time' })
|
|
@Column(DataType.DATE)
|
|
updatedAt: Date;
|
|
|
|
@ApiProperty({ type: String, required: false })
|
|
@Column(DataType.TEXT)
|
|
createdBy: string;
|
|
|
|
@ApiProperty({ type: String, required: false })
|
|
@Column(DataType.TEXT)
|
|
modifiedBy: string;
|
|
|
|
@ApiProperty({ type: Date, required: false })
|
|
@Column(DataType.DATEONLY)
|
|
deletedAt: Date;
|
|
|
|
@ApiProperty({ type: Number })
|
|
@Column(DataType.INTEGER)
|
|
version: number;
|
|
|
|
@ApiProperty({ type: String })
|
|
@Column(DataType.TEXT)
|
|
status: string;
|
|
}
|