import express from 'express';
import TaxiMapController from '../controllers/taxiMapController.js';
import { authenticate } from '../middleware/authMiddleware.js';

const router = express.Router();
const taxiMapController = new TaxiMapController();

// All routes require authentication
router.use(authenticate);

// Map types routes
router.get('/map-types', (req, res) => taxiMapController.getMapTypes(req, res));

// Maps routes
router.get('/maps', (req, res) => taxiMapController.getMaps(req, res));
router.get('/maps/default', (req, res) => taxiMapController.getDefaultMap(req, res));
router.get('/maps/:mapId', (req, res) => taxiMapController.getMapById(req, res));

// Map management routes (admin only - you might want to add admin middleware)
router.post('/maps', (req, res) => taxiMapController.createMap(req, res));
router.put('/maps/:mapId', (req, res) => taxiMapController.updateMap(req, res));
router.delete('/maps/:mapId', (req, res) => taxiMapController.deleteMap(req, res));
router.post('/maps/:mapId/set-default', (req, res) => taxiMapController.setDefaultMap(req, res));

export default router;
