text: const mongoose = require('mongoose');
  
  const playerSchema = mongoose.Schema({
    name: { type: String, required: true },
    playerPool: {
      type: mongoose.Schema.Types.ObjectId,
      ref: 'PlayerPool'
    },
    team: {
      type: mongoose.Schema.Types.ObjectId,
      ref: 'Team'
    },
    tournament: {
      type: mongoose.Schema.Types.ObjectId,
      ref: 'Tournament'
    },
    user: {
      type: mongoose.Schema.Types.ObjectId,
      ref: 'User'
    }
  });
  
  playerSchema.set('toJSON', {
    transform: (document, returnedObject) => {
      returnedObject.id = returnedObject._id.toString();
      delete returnedObject.tournament;
      delete returnedObject.user;
      delete returnedObject._id;
      delete returnedObject.__v;
    }
  });
  
  const Player = mongoose.model('Player', playerSchema);
  
  module.exports = Player;
  