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

const SafetyTools = sequelize.define("SafetyTools", {
  toolType: {
    type: DataTypes.ENUM,
    allowNull: false,
    values: [
      "job-safety-analysis",
      "toolbox-meeting",
      "pre-task-checklist",
      "equipment-controller",
      // Legacy values for backward compatibility
      "toolbox-talk",
      "equipment-control",
    ],
  },
  data: {
    type: DataTypes.JSON,
    allowNull: true,
  },
});

module.exports = SafetyTools;
