const Sequelize = require('sequelize');
module.exports = function(sequelize, DataTypes) {
  return sequelize.define('project_topics', {
    id: {
      allowNull: false,
      primaryKey: true,
      type: DataTypes.UUID,
      defaultValue: DataTypes.UUIDV4
    },
    project_type_id: {
      type: DataTypes.UUID,
      allowNull: false
    },
    student_user_id: {
      type: DataTypes.UUID,
      allowNull: false
    },
    lecturer_user_id: {
      type: DataTypes.UUID,
      allowNull: false
    },
    topic: {
      type: DataTypes.TEXT,
      allowNull: true
    },
    session_id: {
      type: DataTypes.UUID,
      allowNull: true
    },
    is_approved: {
      type: DataTypes.BOOLEAN,
      allowNull: false,
      defaultValue: 0
    },
    approval_comment: {
      type: DataTypes.TEXT,
      allowNull: true
    },
    active: {
      type: DataTypes.BOOLEAN,
      allowNull: false,
      defaultValue: 1
    }
  }, {
    sequelize,
    tableName: 'project_topics',
    timestamps: true
  });
};
