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

export class IcrClassroomquestion {
  [PrimaryKeyProp]?: 'Id';
  Id!: bigint;
  ClassRoomCourseId!: bigint;
  ClassId!: bigint;
  Type!: number;
  UseType!: number;
  OptionalItems?: string;
  RightOptions?: string;
  StartTime?: Date;
  EndTime?: Date;
  Status!: number;
  Remark?: string;
  Revision!: number;
  CreatedBy?: bigint;
  CreatedTime!: Date;
  UpdatedBy?: bigint;
  UpdatedTime?: Date;
  IsDeleted!: unknown;
  QuestionPackageId?: bigint;
  QuestionPackageItemId?: bigint;
  QuestionPackageNo?: bigint;
  QuestionPackageSort?: number;
}

export const IcrClassroomquestionSchema = defineEntity({
  class: IcrClassroomquestion,
  comment: '课堂问题',
  properties: {
    Id: p.bigint().primary().name('Id').unsigned(false).autoincrement(false).comment('主键Id'),
    ClassRoomCourseId: p.bigint().name('ClassRoomCourseId').comment('课堂课程Id'),
    ClassId: p.bigint().name('ClassId').comment('问题属于的本班Id'),
    Type: p.integer().name('Type').comment('试题类型;1 单选题 2 多选题 3 主观题  4 问题包）'),
    UseType: p.integer().name('UseType').comment('使用类型0-普通题 1实时主观题 2.竞赛主观题 3.自定义竞赛题'),
    OptionalItems: p.string().name('OptionalItems').nullable().comment('可选项;'),
    RightOptions: p.string().name('RightOptions').nullable().comment('正确选项;'),
    StartTime: p.datetime().name('StartTime').length(3).nullable().comment('试题开始时间'),
    EndTime: p.datetime().name('EndTime').length(3).nullable().comment('试题结束时间'),
    Status: p.integer().name('Status').comment('状态;1. 答题开始 2 答题结束 255 已废弃'),
    Remark: p.string().name('Remark').nullable().comment('备注'),
    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('是否删除'),
    QuestionPackageId: p.bigint().name('QuestionPackageId').nullable().comment('问题包Id'),
    QuestionPackageItemId: p.bigint().name('QuestionPackageItemId').nullable().comment('问题包项Id'),
    QuestionPackageNo: p.bigint().name('QuestionPackageNo').nullable().comment('问题包序号'),
    QuestionPackageSort: p.integer().name('QuestionPackageSort').nullable().comment('问题包排序序号'),
  },
});
