import { Router } from 'express';
import { OrganizationController } from '../controllers/organization.controller';
import { authenticate, requireRole } from '../middleware/auth.middleware';

const router = Router();
const orgController = new OrganizationController();

router.use(authenticate);

// Only admins manage orgs
router.use(requireRole('ADMIN'));

router.post('/', orgController.create);
router.get('/', orgController.getAll);
router.get('/:id', orgController.getById);
router.patch('/:id', orgController.update);

export default router;
