const { DataTypes } = require('sequelize');
const sequelize = require('../db');

const Enemy = sequelize.define('enemy', {
  id: {
    type: DataTypes.INTEGER,
    autoIncrement: true,
    primaryKey: true,
  },
  name: {
    type: DataTypes.STRING,
    allowNull: false,
  },
  description: {
    type: DataTypes.TEXT,
    allowNull: false,
  },
  level: {
    type: DataTypes.INTEGER,
    allowNull: false,
  },
  hp: { 
    type: DataTypes.INTEGER, 
    allowNull: true 
  },
  damage: {
    type: DataTypes.INTEGER,
    allowNull: false,
  },
  loot: { 
    type: DataTypes.ARRAY(DataTypes.INTEGER), 
    allowNull: true, defaultValue: [] 
  },
  rarity: {
    type: DataTypes.INTEGER,
    allowNull: false,
  },
});

module.exports = Enemy;
