/*
 * @Author: YKH
 * @Date: 2021-12-21 18:23:13
 * @LastEditTime: 2022-02-16 15:44:51
 * @Description: 
 * @FilePath: \cool-admin\cool-admin-midway-master\src\app\modules\shuyou\entity\special_game_account.ts
 */
import { EntityModel } from '@midwayjs/orm';
import { BaseEntity } from 'midwayjs-cool-core';
import { Column, Index } from 'typeorm';

/**
 * 特殊账号表（qq卡..）
 */
@EntityModel('special_account')
@Index(["card_text", "type_id"], { unique: true }) // 联合索引
export class ShuyouSpecialAccountEntity extends BaseEntity {

  @Column({ comment: '卡号', length: 50 })
  card_text: string;

  @Column({ comment: '密码', length: 50 })
  card_password: string;

  @Index()
  @Column({ comment: '卡类型id' })
  type_id: string;

  @Column({ comment: '总金额', type: 'decimal', scale: 2 })
  amount_all: number;

  @Column({ comment: '余额', type: 'decimal', scale: 2 })
  amount_balance: number;

  @Column({ comment: '取走时间', nullable: true })
  get_time: Date;

  @Column({ comment: '卡所处状态:0.未使用 1.已归还 2.已取出不锁 3.已取出并加锁 4.失效 5.余额不足 6.无法使用 7.已被删除', default: 0, type: 'tinyint' })
  status: number;

  @Column({ comment: '释放日期', nullable: true })
  releaseTime: Date;

  @Column({ comment: '备注', nullable: true })
  remark: string;

}
