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

const TrainingModule = sequelize.define("TrainingModule", {
  title: {
    type: DataTypes.STRING,
    allowNull: false,
  },
  description: {
    type: DataTypes.TEXT,
  },
  order: {
    type: DataTypes.INTEGER,
    defaultValue: 0,
  },
  // TrainingCourseId added via association
}, {
  freezeTableName: true,
  tableName: 'TrainingModules'
});

module.exports = TrainingModule;
