// Import Sequelize and define a model
const { sequelize } = require("../../config/db");
const { DataTypes } = require("sequelize");
const Admin = require("./Admin");
const AdminRole = require("./AdminRole");

const Role = sequelize.define(
  "Role",
  {
    id: {
      type: DataTypes.INTEGER,
      primaryKey: true,
      autoIncrement: true,
    },
    role: {
      type: DataTypes.STRING(45),
      allowNull: false,
    },
    description: {
      type: DataTypes.STRING,
      allowNull: true,
    },
    createdAt: {
      type: DataTypes.DATE,
      allowNull: false,
    },
    updatedAt: {
      type: DataTypes.DATE,
      allowNull: false,
    },
  },
  {
    tableName: "roles", // Specify the table name explicitly
    timestamps: true, // Enable timestamps (createdAt and updatedAt)
  }
);


module.exports = Role;
