import express from 'express';
import { authenticate } from '../middleware/authMiddleware.js';
import Match3Controller from '../controllers/match3Controller.js';

const router = express.Router();
const match3Controller = new Match3Controller();

// Alle Routen benötigen Authentifizierung
router.use(authenticate);

// Kampagnen-Routen
router.get('/campaigns', match3Controller.getCampaigns);
router.get('/campaigns/:id', match3Controller.getCampaign);

// Level-Routen
router.get('/levels/:id', match3Controller.getLevel);

// Fortschritt-Routen
router.get('/campaigns/:campaignId/progress', match3Controller.getUserProgress);
router.post('/campaigns/:campaignId/levels/:levelId/progress', match3Controller.updateLevelProgress);
router.post('/campaigns/:campaignId/cleanup', match3Controller.cleanupUserProgress);

// Statistiken-Routen
router.get('/stats', match3Controller.getUserStats);

export default router;
