/*
 * @Author: YKH
 * @Date: 2022-09-01 20:41:58
 * @LastEditTime: 2022-10-08 13:37:43
 * @Description: file content
 * @FilePath: \cool-admin-3.x\cool-admin-midway-master\src\app\modules\shuyou\entity\rent_computer.ts
 */
import { EntityModel } from '@midwayjs/orm';
import { Column, Index } from 'typeorm';
import { BaseEntity } from 'midwayjs-cool-core';

/**
 * 租机表
 */
@EntityModel('shuyou_rent_computer')
export class ShuyouRentComputerEntity extends BaseEntity {
  @Index()
  @Column({ comment: '电脑编号', length: 100 })
  pc_num: string;

  @Index()
  @Column({ comment: '电脑名称', length: 100 })
  pc_name: string;

  @Column({ comment: '租机店铺ID' })
  shop_id: number;

  @Index()
  @Column({ comment: '套餐', length: 100, nullable: true })
  set_meal: string;

  @Column({ type: 'datetime', comment: '起租时间' })
  rent_start: Date;

  @Column({ comment: '租机时常（天）' })
  rent_duration: number;

  @Column({ type: 'datetime', comment: '到期时间' })
  rent_end: Date;

  @Column({
    comment: '价格套餐 0:天卡 1:周卡 2:月卡',
    default: 0,
    type: 'tinyint',
  })
  price_type: number;

  @Column({
    comment: '价格标准',
    type: 'decimal',
    precision: 10,
    scale: 2,
    default: 0,
  })
  rent_price: number;

  @Column({
    comment: '折算天租金',
    type: 'decimal',
    precision: 10,
    scale: 5,
    default: 0,
  })
  rent_price_day: number;

  @Column({
    comment: '结算方式 0:先付后用 1:先用后付 2:其他方式',
    default: 0,
    type: 'tinyint',
  })
  pay_method: number;

  @Column({
    comment: '是否到期 0:否 1:是 2:明日到期',
    default: 0,
    type: 'tinyint',
  })
  is_expire: number;

  @Column({
    type: 'decimal',
    comment: '当前租赁期内已产生多少租金',
    precision: 10,
    scale: 5,
    default: 0,
  })
  rent_price_used: number;

  @Column({ comment: '租赁人', nullable: true })
  rent_person_id: number;

  // 任务ID列表,映射使用人列表
  taskIdList: string[];

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

  @Column({
    comment: '是否下架 0:否 1:是',
    default: 0,
    type: 'tinyint',
  })
  is_offShelf: number;
}
