'use strict';
const {
  Model
} = require('sequelize');
module.exports = (sequelize, DataTypes) => {
  class UserProfile 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
    }
  }
 UserProfile.init({
  userId: {
    type: DataTypes.INTEGER,
    allowNull: false,
    unique: true
  },
  dateOfBirth: {
    type: DataTypes.DATE
  },
  gender: {
    type: DataTypes.ENUM(
      'male',
      'female',
      'non_binary',
      'other',
      'prefer_not_to_say'
    ),
    allowNull: true
  },
  profileImage: {
    type: DataTypes.STRING
  },
  bio: {
    type: DataTypes.TEXT
  },
  preferences: {
    type: DataTypes.JSON,
    defaultValue: {}
  }
}, {
  sequelize,
  modelName: 'UserProfile',
});
  return UserProfile;
};