module.exports = (db, DataTypes) => {
  return db.define("bmorder", {
    merchantId: DataTypes.INTEGER,
    companyId: DataTypes.INTEGER,
    userId: DataTypes.INTEGER,
    orderNo: DataTypes.STRING(100),
    status: DataTypes.INTEGER,
    ownerId: DataTypes.INTEGER,
    auditStatus:{ type:DataTypes.INTEGER, field: 'audit_status', comment:'审核状态 0待审核 1审核通过 2审核驳回'},
    auditId:{ type:DataTypes.INTEGER, field: 'audit_id', comment:'审核人ID'},
    rejectReason:{ type:DataTypes.STRING, field: 'reject_reason', comment:'驳回原因'},
  }, {
    paranoid: true, //假的删除
    underscored: true,
    version: true,
    freezeTableName: true,
    //freezeTableName: true,
    // define the table's name
    tableName: 'bm_order',
    validate: {}
  });
}