const User = require('./User');
const GymClass = require('./GymClass');
const Booking = require('./Booking');
const { sequelize } = require('../config/db');

// Define associations
User.hasMany(Booking, { foreignKey: 'userId' });
Booking.belongsTo(User, { foreignKey: 'userId' });

GymClass.hasMany(Booking, { foreignKey: 'gymClassId' });
Booking.belongsTo(GymClass, { foreignKey: 'gymClassId' });

module.exports = {
  sequelize,
  User,
  GymClass,
  Booking
};