const config = require('../../config');
const providers = config.providers;
const crypto = require('crypto');
const bcrypt = require('bcrypt');
const moment = require('moment');

module.exports = function(sequelize, DataTypes) {
  const sss_contribution_tables = sequelize.define(
    'sss_contribution_tables',
    {
      id: {
        type: DataTypes.UUID,
        defaultValue: DataTypes.UUIDV4,
        primaryKey: true,
      },

salaryFrom: {
        type: DataTypes.DECIMAL,
      
      

      },

salaryTo: {
        type: DataTypes.DECIMAL,
      
      

      },

msc: {
        type: DataTypes.DECIMAL,
      
      

      },

employeeShare: {
        type: DataTypes.DECIMAL,
      
      

      },

employerShare: {
        type: DataTypes.DECIMAL,
      
      

      },

wispEmployee: {
        type: DataTypes.DECIMAL,
      
      

      },

wispEmployer: {
        type: DataTypes.DECIMAL,
      
      

      },

effectiveYear: {
        type: DataTypes.INTEGER,
      
      

      },

      importHash: {
        type: DataTypes.STRING(255),
        allowNull: true,
        unique: true,
      },
    },
    {
      timestamps: true,
      paranoid: true,
      freezeTableName: true,
    },
  );

  sss_contribution_tables.associate = (db) => {


/// loop through entities and it's fields, and if ref === current e[name] and create relation has many on parent entity













































//end loop






    db.sss_contribution_tables.belongsTo(db.users, {
      as: 'createdBy',
    });

    db.sss_contribution_tables.belongsTo(db.users, {
      as: 'updatedBy',
    });
  };



  return sss_contribution_tables;
};


