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

export class IcrTerminalmessage {
  [PrimaryKeyProp]?: 'Id';
  Id!: bigint;
  TerminalId!: bigint;
  TerminalCode?: string;
  MessageType!: number;
  Status!: number;
  Content?: unknown;
  Revision!: number;
  CreatedBy?: bigint;
  CreatedTime!: Date;
  UpdatedBy?: bigint;
  UpdatedTime?: Date;
  IsDeleted!: unknown;
}

export const IcrTerminalmessageSchema = defineEntity({
  class: IcrTerminalmessage,
  comment: '终端消息',
  properties: {
    Id: p.bigint().primary().name('Id').unsigned(false).autoincrement(false).comment('主键Id'),
    TerminalId: p.bigint().name('TerminalId').comment('终端编号'),
    TerminalCode: p.string().name('TerminalCode').nullable().comment('终端编码'),
    MessageType: p.integer().name('MessageType').comment('消息内容'),
    Status: p.integer().name('Status').comment('终端消息状态'),
    Content: p.array().name('Content').length(16777215).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('是否删除'),
  },
});
