import { Model, DataTypes } from 'sequelize';
import { sequelize } from '../../../utils/sequelize.js';

class ReputationActionType extends Model {}

ReputationActionType.init(
  {
    tr: {
      type: DataTypes.STRING,
      allowNull: false,
    },
    cost: {
      type: DataTypes.INTEGER,
      allowNull: false,
    },
    baseGain: {
      type: DataTypes.INTEGER,
      allowNull: false,
      field: 'base_gain',
    },
    decayFactor: {
      type: DataTypes.FLOAT,
      allowNull: false,
      field: 'decay_factor',
    },
    minGain: {
      type: DataTypes.INTEGER,
      allowNull: false,
      defaultValue: 0,
      field: 'min_gain',
    },
    decayWindowDays: {
      type: DataTypes.INTEGER,
      allowNull: false,
      defaultValue: 7,
      field: 'decay_window_days',
    },
  },
  {
    sequelize,
    modelName: 'ReputationActionType',
    tableName: 'reputation_action',
    schema: 'falukant_type',
    timestamps: false,
    underscored: true,
  }
);

export default ReputationActionType;


