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

export class IcrFeedbackresult {
  [PrimaryKeyProp]?: 'Id';
  Id!: IType<number, bigint>;
  FeedBackId!: IType<number, bigint>;
  ClassId!: IType<number, bigint>;
  ClassRoomCourseId!: IType<number, bigint>;
  StudentId!: IType<number, bigint>;
  SelectedOptions?: string;
  Status!: number;
  Remark?: string;
  Revision!: number;
  CreatedBy?: IType<number, bigint>;
  CreatedTime!: Date;
  UpdatedBy?: IType<number, bigint>;
  UpdatedTime?: Date;
  IsDeleted!: unknown;
}

export const IcrFeedbackresultSchema = defineEntity({
  class: IcrFeedbackresult,
  comment: '反馈结果',
  properties: {
    Id: p.bigint().primary().name('Id').columnType('bigint').unsigned(false).autoincrement(false).comment('主键Id'),
    FeedBackId: p.bigint().name('FeedBackId').columnType('bigint').comment('反馈Id'),
    ClassId: p.bigint().name('ClassId').columnType('bigint').comment('班级编号'),
    ClassRoomCourseId: p.bigint().name('ClassRoomCourseId').columnType('bigint').comment('课堂课程Id'),
    StudentId: p.bigint().name('StudentId').columnType('bigint').comment('学生Id'),
    SelectedOptions: p.string().name('SelectedOptions').nullable().comment('选中的选项'),
    Status: p.integer().name('Status').comment('状态(0-未选择 1-已选择)'),
    Remark: p.string().name('Remark').nullable().comment('备注'),
    Revision: p.integer().name('Revision').comment('乐观锁'),
    CreatedBy: p.bigint().name('CreatedBy').columnType('bigint').nullable().comment('创建者用户Id'),
    CreatedTime: p.datetime().name('CreatedTime').length(3).comment('创建时间'),
    UpdatedBy: p.bigint().name('UpdatedBy').columnType('bigint').nullable().comment('修改者用户Id'),
    UpdatedTime: p.datetime().name('UpdatedTime').length(3).nullable().comment('修改时间'),
    IsDeleted: p.array().name('IsDeleted').comment('是否删除'),
  },
});
