import express from 'express';
import { authenticate } from '../middleware/authMiddleware.js';
import { 
  getSeasons, 
  getCurrentSeason, 
  createSeason, 
  getSeason, 
  deleteSeason 
} from '../controllers/seasonController.js';

const router = express.Router();

// Get all seasons
router.get('/', authenticate, getSeasons);

// Get current season (creates if not exists)
router.get('/current', authenticate, getCurrentSeason);

// Get a specific season
router.get('/:seasonid', authenticate, getSeason);

// Create a new season
router.post('/', authenticate, createSeason);

// Delete a season
router.delete('/:seasonid', authenticate, deleteSeason);

export default router;
