import db from "../../database/db.js";

const TrueFalseModel = (DataTypes) => {
  const TrueFalse = db.define(
    "true_false",
    {
      ID_TRUE_FALSE: {
        type: DataTypes.UUID,
        primaryKey: true,
        defaultValue: DataTypes.UUIDV4,
        allowNull: false,
        validate: {
          notEmpty: true,
        },
      },
      ID_ADMIN_EXERCISE: {
        type: DataTypes.UUID,
        allowNull: false,
        references: {
          model: "admin_exercise",
          key: "ID_ADMIN_EXERCISE",
        },
        validate: {
          notEmpty: true,
        },
      },
      IS_TRUE: {
        type: DataTypes.TINYINT(1),
        allowNull: false,
      },
      TIME_TRUE_FALSE: {
        type: DataTypes.DATE,
        allowNull: true,
        defaultValue: DataTypes.NOW,
      },
    },
    {
      timestamps: false,
      tableName: "true_false",
    }
  );

  return TrueFalse;
};

export default TrueFalseModel;