module.exports = (sequelize, DataTypes) => {
  const { UUID, UUIDV4, STRING, TEXT } = DataTypes;
  const ListingSpots = sequelize.define(
    'ListingSpots',
    {
      id: {
        type: UUID,
        defaultValue: UUIDV4,
        allowNull: false,
        primaryKey: true,
      },
      listing_id: {
        type: UUID,
        allowNull: true,
      },
      name: {
        type: STRING,
        allowNull: true,
      },
      inclusions: {
        type: TEXT,
        allowNull: true,
      },
      capacity: {
        type: DataTypes.INTEGER,
        allowNull: false,
        defaultValue: 1,
      },
    },
    {
      tableName: 'listing_spots',
      timestamps: false,
    },
  );

  return ListingSpots;
};
