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

const TaxiMapType = sequelize.define('TaxiMapType', {
  id: {
    type: DataTypes.INTEGER,
    primaryKey: true,
    autoIncrement: true
  },
  name: {
    type: DataTypes.STRING(50),
    allowNull: false,
    unique: true
  },
  description: {
    type: DataTypes.TEXT,
    allowNull: true
  },
  tileType: {
    type: DataTypes.STRING(50),
    allowNull: false,
    comment: 'Type of tile: cornerBottomLeft, cornerBottomRight, cornerTopLeft, cornerTopRight, horizontal, vertical, cross, fuelHorizontal, fuelVertical, tLeft, tRight, tUp, tDown'
  },
  isActive: {
    type: DataTypes.BOOLEAN,
    allowNull: false,
    defaultValue: true
  },
  // createdAt/updatedAt via timestamps
}, {
  tableName: 'taxi_map_type',
  schema: 'taxi',
  timestamps: true,
  underscored: true,
  indexes: [
    {
      unique: true,
      fields: ['name']
    },
    {
      fields: ['tile_type']
    },
    {
      fields: ['is_active']
    }
  ]
});

export default TaxiMapType;
