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

class RegionDistance extends Model {}

RegionDistance.init(
  {
    sourceRegionId: {
      type: DataTypes.INTEGER,
      allowNull: false
    },
    targetRegionId: {
      type: DataTypes.INTEGER,
      allowNull: false
    },
    transportMode: {
      // e.g. 'land', 'water', 'air' – should match VehicleType.transportMode
      type: DataTypes.STRING,
      allowNull: false,
    },
    distance: {
      // distance between regions (e.g. in abstract units, used for travel time etc.)
      type: DataTypes.DOUBLE,
      allowNull: false,
    },
  },
  {
    sequelize,
    modelName: 'RegionDistance',
    tableName: 'region_distance',
    schema: 'falukant_data',
    timestamps: false,
    underscored: true,
  }
);

export default RegionDistance;



