import {
  Column,
  PrimaryKey,
  Table,
  HPSFIR_ORM_TYPE_E,
} from 'hpsfir-orm';

@Table('test', {
  softDelete: true,
  softDeleteExpireTime: (process.env.SOFT_DELETE_EXPIRE_TIME && Number(process.env.SOFT_DELETE_EXPIRE_TIME)) || undefined,
})
export class TestPo {

  @PrimaryKey({ type: HPSFIR_ORM_TYPE_E.LONG })
  public id!: number;

  @Column()
  public name!: string;

  @Column()
  public password!: string;

  @Column({
    dbName: 'delete_at',
    default: new Date(0),
    deleteValue: () => new Date(),
  })
  public deleteAt?: Date;

  @Column({ dbName: 'create_time' })
  public createTime!: Date;

}
