const express = require('express');
const router = express.Router();
const authController = require('../controllers/authController');
const { authenticateToken, requireManager } = require('../middleware/auth');

// Public routes
router.post('/login', authController.login);

// Protected routes
router.use(authenticateToken);

// Profile management
router.get('/profile', authController.getProfile);
router.put('/profile', authController.updateProfile);
router.put('/change-password', authController.changePassword);

// Manager only routes
router.post('/create-member', requireManager, authController.createMember);

module.exports = router;
