import express from 'express';
const router = express.Router();
import * as outletController from './outlet.controller.js';
import { authenticate } from '../../common/middleware/auth.js';
import { checkRole } from '../../common/middleware/roleCheck.js';
import { ROLES } from '../../common/config/constants.js';

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

router.get('/', outletController.getOutlets);
router.get('/:id', outletController.getOutletById);
router.post('/', checkRole([ROLES.SUPER_ADMIN, ROLES.DD_ADMIN]) as any, outletController.createOutlet);
router.put('/:id', checkRole([ROLES.SUPER_ADMIN, ROLES.DD_ADMIN]) as any, outletController.updateOutlet);

export default router;
