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

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

module.exports = Location;
