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

class Learning extends Model {}

Learning.init(
  {
    learningRecipientId: {
      type: DataTypes.INTEGER,
      allowNull: false},
    productId: {
      type: DataTypes.INTEGER,
      allowNull: true,
      defaultValue: null},
    learnAllProducts: {
        type: DataTypes.BOOLEAN,
        allowNull: false,
        defaultValue: false},
    associatedFalukantUserId: {
      type: DataTypes.INTEGER,
      allowNull: true,
      defaultValue: null},
    associatedLearningCharacterId: {
      type: DataTypes.INTEGER,
      allowNull: true,
      defaultValue: null},
    learningIsExecuted: {
      type: DataTypes.BOOLEAN,
      allowNull: false,
      defaultValue: false}
  },
  {
    sequelize,
    modelName: 'Learning',
    tableName: 'learning',
    schema: 'falukant_data',
    timestamps: true,
    underscored: true}
);

export default Learning;
