/* eslint-disable*/

'use strict';

module.exports = dc => {
  const DataTypes = dc.ORM;
  const sequelize = dc.orm;
  const PositionRating = sequelize.define("positionRating", {
    id: {
      type: DataTypes.INTEGER,
      allowNull: false,
      defaultValue: null,
      comment: null,
      primaryKey: true,
      field: "id",
      autoIncrement: true,
      unique: "position_rating_id_uindex"
    },
    pepUserId: {
      type: DataTypes.INTEGER,
      allowNull: false,
      defaultValue: null,
      comment: null,
      primaryKey: false,
      field: "pep_user_id",
      autoIncrement: false,
      references: {
        key: "pep_user_id",
        model: "member"
      }
    },
    ratingTime: {
      type: DataTypes.DATE,
      allowNull: false,
      defaultValue: null,
      comment: "评级时间",
      primaryKey: false,
      field: "rating_time",
      autoIncrement: false
    },
    theoryBasicScore: {
      type: DataTypes.DOUBLE,
      allowNull: false,
      defaultValue: null,
      comment: "理论基础测评成绩",
      primaryKey: false,
      field: "theory_basic_score",
      autoIncrement: false
    },
    theoryPassed: {
      type: DataTypes.BOOLEAN,
      allowNull: false,
      defaultValue: null,
      comment: "理论基础测评是否通过(≥60",
      primaryKey: false,
      field: "theory_passed",
      autoIncrement: false
    },
    totalScore: {
      type: DataTypes.DOUBLE,
      allowNull: false,
      defaultValue: null,
      comment: "评级总成绩",
      primaryKey: false,
      field: "total_score",
      autoIncrement: false
    },
    totalRatingPassed: {
      type: DataTypes.BOOLEAN,
      allowNull: false,
      defaultValue: null,
      comment: "评级总成绩是否通过(K≥60)",
      primaryKey: false,
      field: "total_rating_passed",
      autoIncrement: false
    },
    technicalGrade: {
      type: DataTypes.STRING,
      allowNull: false,
      defaultValue: null,
      comment: "技术职级等级",
      primaryKey: false,
      field: "technical_grade",
      autoIncrement: false
    }
  }, {
    tableName: "position_rating",
    comment: "",
    indexes: []
  });
  
  dc.models.PositionRating = PositionRating;
  return PositionRating;
};