import { PrimaryKeyProp, defineEntity, p } from '@mikro-orm/core';

export class IcrHomeworkevaluation {
  [PrimaryKeyProp]?: 'Id';
  Id!: bigint;
  Name?: string;
  StudentId!: bigint;
  HomeworkId!: bigint;
  BookId!: bigint;
  ArticleCount!: number;
  AccuracyRate!: number;
  AnswerTime!: bigint;
  Detail?: unknown;
  AiInterpret?: string;
  Revision!: number;
  CreatedBy?: bigint;
  CreatedTime!: Date;
  UpdatedBy?: bigint;
  UpdatedTime?: Date;
  IsDeleted!: unknown;
}

export const IcrHomeworkevaluationSchema = defineEntity({
  class: IcrHomeworkevaluation,
  properties: {
    Id: p.bigint().primary().name('Id').unsigned(false).autoincrement(false).comment('主键Id'),
    Name: p.string().name('Name').nullable().comment('名称'),
    StudentId: p.bigint().name('StudentId').comment('学生Id').index('idx_ICR_HomeworkEvaluation_01'),
    HomeworkId: p.bigint().name('HomeworkId').comment('作业Id').index('idx_ICR_HomeworkEvaluation_02'),
    BookId: p.bigint().name('BookId').comment('书Id').index('idx_ICR_HomeworkEvaluation_03'),
    ArticleCount: p.integer().name('ArticleCount').comment('文章数量'),
    AccuracyRate: p.float().name('AccuracyRate').comment('正确率'),
    AnswerTime: p.bigint().name('AnswerTime').comment('作答时间'),
    Detail: p.array().name('Detail').length(4294967295).nullable().comment('详情'),
    AiInterpret: p.string().name('AiInterpret').nullable().comment('AI解读'),
    Revision: p.integer().name('Revision').comment('乐观锁'),
    CreatedBy: p.bigint().name('CreatedBy').nullable().comment('创建者用户Id'),
    CreatedTime: p.datetime().name('CreatedTime').length(3).comment('创建时间'),
    UpdatedBy: p.bigint().name('UpdatedBy').nullable().comment('修改者用户Id'),
    UpdatedTime: p.datetime().name('UpdatedTime').length(3).nullable().comment('修改时间'),
    IsDeleted: p.array().name('IsDeleted').comment('是否删除'),
  },
});
