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

class Transport extends Model {}

Transport.init(
  {
    sourceRegionId: {
      type: DataTypes.INTEGER,
      allowNull: false,
    },
    targetRegionId: {
      type: DataTypes.INTEGER,
      allowNull: false,
    },
    productId: {
      type: DataTypes.INTEGER,
      allowNull: true, // Nullable für leere Transporte (nur Fahrzeuge bewegen)
    },
    size: {
      type: DataTypes.INTEGER,
      allowNull: true, // Nullable für leere Transporte (nur Fahrzeuge bewegen)
    },
    vehicleId: {
      type: DataTypes.INTEGER,
      allowNull: false,
    },
  },
  {
    sequelize,
    modelName: 'Transport',
    tableName: 'transport',
    schema: 'falukant_data',
    timestamps: true,
    underscored: true,
  }
);

export default Transport;


