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

/**
 * 垃圾属性信息
 */
@Entity('t_basicdata_wastetype')
export class BasicdataWastetypeEntity extends BaseEntity {
  @Index()
  @Column({ comment: '代码' })
  code: string;

  @Index()
  @Column({ comment: '名称' })
  name: string;

  @Column({ comment: '是否可回收', dict: ['否', '是'], default: 0 })
  isRecyclable: number;

  @Column({
    comment: '单价',
    type: 'decimal',
    precision: 10,
    scale: 2,
    default: 0.0,
  })
  price: number;

  @Column({ comment: '货币', default: 'CNY' })
  currency: string;

  @Column({ comment: '桶/袋重', default: 0 })
  packageWeight: number;

  @Column({ comment: '碳减排方向', dict: ['正', '负'], default: 0 })
  carbonDirection: number;

  @Column({
    comment: '碳减因数',
    type: 'decimal',
    precision: 10,
    scale: 2,
    default: 0.0,
  })
  carbonFactor: number;

  @Column({ comment: '因数单位' })
  factorUnit: string;

  @Column({ comment: '公式表达式', nullable: true })
  formula: string;

  @Column({ comment: '来源标准', nullable: true })
  sourceStandard: string;

  @Column({ comment: '是否启用', dict: ['禁用', '启用'], default: 1 })
  status: number;

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