import express from 'express';
const router = express.Router();

import constitutionalRoutes from './constitutional.routes.js';
import * as relocationController from './relocation.controller.js';
import { authenticate } from '../../common/middleware/auth.js';

// Resignations submodule - MOVED TO TOP-LEVEL server.ts for consolidation
// router.use('/resignations', resignationRoutes);


// Constitutional changes submodule - using the new dedicated router
router.use('/constitutional', constitutionalRoutes);

// Relocation submodule
router.post('/relocation', authenticate as any, relocationController.submitRequest);
router.get('/relocation', authenticate as any, relocationController.getRequests);
router.get('/relocation/:id', authenticate as any, relocationController.getRequestById);
router.post('/relocation/:id/action', authenticate as any, relocationController.takeAction);
router.post('/relocation/:id/documents', authenticate as any, relocationController.uploadDocuments);
router.post('/relocation/:id/documents/:documentId/verify', authenticate as any, relocationController.verifyDocument);
router.post('/relocation/:id/documents/:documentId/reject', authenticate as any, relocationController.rejectDocument);

export default router;
