import { BaseEntity } from '../../base/entity/base';
import { Column, Entity, Index } from 'typeorm';

/**
 * 称重上报原始数据
 */
@Entity('t_push_weight')
export class PushWeightEntity extends BaseEntity {
  @Index()
  @Column({ comment: '设备号' })
  deviceNo: string;

  @Index()
  @Column({ comment: '上传时间', type: 'datetime', nullable: true })
  uploadTime: Date;

  @Index()
  @Column({ comment: '垃圾类型' })
  garbageType: string;

  @Column({
    comment: '垃圾重量',
    type: 'decimal',
    precision: 10,
    scale: 2,
    default: 0,
  })
  weight: number;

  @Column({ comment: '其他数据', type: 'text', nullable: true })
  extraData: string;
}
