forked from hangshuo652/aurak
112 lines
2.8 KiB
TypeScript
112 lines
2.8 KiB
TypeScript
import {
|
|
Entity,
|
|
PrimaryGeneratedColumn,
|
|
Column,
|
|
CreateDateColumn,
|
|
UpdateDateColumn,
|
|
ManyToOne,
|
|
JoinColumn,
|
|
} from 'typeorm';
|
|
import { Tenant } from '../../tenant/tenant.entity';
|
|
import { KnowledgeBase } from '../../knowledge-base/knowledge-base.entity';
|
|
import { KnowledgeGroup } from '../../knowledge-group/knowledge-group.entity';
|
|
|
|
@Entity('assessment_templates')
|
|
export class AssessmentTemplate {
|
|
@PrimaryGeneratedColumn('uuid')
|
|
id: string;
|
|
|
|
@Column({ name: 'tenant_id', nullable: true })
|
|
tenantId: string;
|
|
|
|
@ManyToOne(() => Tenant, { nullable: true, onDelete: 'CASCADE' })
|
|
@JoinColumn({ name: 'tenant_id' })
|
|
tenant: Tenant;
|
|
|
|
@Column()
|
|
name: string;
|
|
|
|
@Column({ type: 'text', nullable: true })
|
|
description: string;
|
|
|
|
@Column({ type: 'simple-json', nullable: true })
|
|
keywords: string[];
|
|
|
|
@Column({ type: 'int', name: 'question_count', default: 5 })
|
|
questionCount: number;
|
|
|
|
@Column({
|
|
type: 'simple-json',
|
|
name: 'difficulty_distribution',
|
|
nullable: true,
|
|
})
|
|
difficultyDistribution: {
|
|
standard: number;
|
|
advanced: number;
|
|
specialist: number;
|
|
};
|
|
|
|
@Column({ type: 'varchar', default: 'technical' })
|
|
style: string;
|
|
|
|
@Column({ name: 'knowledge_base_id', nullable: true })
|
|
knowledgeBaseId: string | null;
|
|
|
|
@ManyToOne(() => KnowledgeBase, { nullable: true })
|
|
@JoinColumn({ name: 'knowledge_base_id' })
|
|
knowledgeBase: KnowledgeBase;
|
|
|
|
@Column({ name: 'knowledge_group_id', nullable: true })
|
|
knowledgeGroupId: string | null;
|
|
|
|
@ManyToOne(() => KnowledgeGroup, { nullable: true })
|
|
@JoinColumn({ name: 'knowledge_group_id' })
|
|
knowledgeGroup: KnowledgeGroup;
|
|
|
|
@Column({ type: 'boolean', name: 'is_active', default: true })
|
|
isActive: boolean;
|
|
|
|
@Column({ type: 'int', default: 1 })
|
|
version: number;
|
|
|
|
@Column({ name: 'created_by', nullable: true })
|
|
createdBy: string;
|
|
|
|
@Column({ type: 'simple-json', name: 'linked_group_ids', nullable: true })
|
|
linkedGroupIds: string[];
|
|
|
|
@Column({ type: 'simple-json', name: 'weight_config', nullable: true })
|
|
weightConfig: {
|
|
prompt: number;
|
|
other: number;
|
|
};
|
|
|
|
@Column({ type: 'simple-json', name: 'difficulty_config', nullable: true })
|
|
difficultyConfig: {
|
|
standard: number;
|
|
advanced: number;
|
|
specialist: number;
|
|
};
|
|
|
|
@Column({ type: 'int', name: 'question_count_min', default: 8 })
|
|
questionCountMin: number;
|
|
|
|
@Column({ type: 'int', name: 'question_count_max', default: 10 })
|
|
questionCountMax: number;
|
|
|
|
@Column({ type: 'int', name: 'passing_score', default: 90 })
|
|
passingScore: number;
|
|
|
|
@Column({ type: 'int', name: 'total_time_limit', default: 1800 })
|
|
totalTimeLimit: number;
|
|
|
|
@Column({ type: 'int', name: 'per_question_time_limit', default: 300 })
|
|
perQuestionTimeLimit: number;
|
|
|
|
@CreateDateColumn({ name: 'created_at' })
|
|
createdAt: Date;
|
|
|
|
@UpdateDateColumn({ name: 'updated_at' })
|
|
updatedAt: Date;
|
|
}
|