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

export class IcrHomeworkanswerexplain {
  [PrimaryKeyProp]?: 'Id';
  Id!: bigint;
  HomeworkId!: bigint;
  StudentId!: bigint;
  QuestionId!: bigint;
  AudioStartTime!: bigint;
  AudioEndTime!: bigint;
  AudioUrl?: string;
  PointsUrl?: string;
  OperatorId!: bigint;
  Revision!: number;
  CreatedBy?: bigint;
  CreatedTime!: Date;
  UpdatedBy?: bigint;
  UpdatedTime?: Date;
  IsDeleted!: unknown;
  Case: number & Opt = 0;
  Status: number & Opt = 0;
}

export const IcrHomeworkanswerexplainSchema = defineEntity({
  class: IcrHomeworkanswerexplain,
  comment: '书页问题;',
  properties: {
    Id: p.bigint().primary().name('Id').unsigned(false).autoincrement(false).comment('主键Id'),
    HomeworkId: p.bigint().name('HomeworkId').comment('作业Id'),
    StudentId: p.bigint().name('StudentId').comment('学生Id'),
    QuestionId: p.bigint().name('QuestionId').comment('问题Id'),
    AudioStartTime: p.bigint().name('AudioStartTime').comment('音频开始时间'),
    AudioEndTime: p.bigint().name('AudioEndTime').comment('音频结束时间'),
    AudioUrl: p.string().name('AudioUrl').nullable().comment('音频地址'),
    PointsUrl: p.string().name('PointsUrl').nullable().comment('点位数据地址'),
    OperatorId: p.bigint().name('OperatorId').comment('操作人Id'),
    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('是否删除'),
    Case: p.integer().name('Case').comment('0-无图 1-原问题图片 2-回答图片'),
    Status: p.integer().name('Status').comment('0-正常 1-过时(之前的)'),
  },
});
