text: "use strict";
  const { Model } = require("sequelize");
  module.exports = (sequelize, DataTypes) => {
    class Event extends Model {
      /**
       * Helper method for defining associations.
       * This method is not a part of Sequelize lifecycle.
       * The `models/index` file will call this method automatically.
       */
      static associate(models) {
        // define association here
        Event.belongsTo(models.User);
        Event.belongsToMany(models.Vendor, { through: "VendorEvent" });
      }
    }
    Event.init(
      {
        event_name: {
          type: DataTypes.STRING,
          allowNull: false,
        },
        event_date: {
          type: DataTypes.DATE,
          allowNull: false,
        },
        bride_groom1: {
          type: DataTypes.STRING,
          allowNull: false,
        },
        bride_groom2: {
          type: DataTypes.STRING,
          allowNull: false,
        },
        budget: {
          type: DataTypes.INTEGER,
          allowNull: false,
        },
        estimated_guests: {
          type: DataTypes.INTEGER,
          allowNull: false,
        },
        user_email: {
          type: DataTypes.STRING,
          allowNull: false,
        },
      },
      {
        sequelize,
        modelName: "Event",
      }
    );
    return Event;
  };
  