import express from 'express';
const router = express.Router();
import * as collaborationController from './collaboration.controller.js';
import { authenticate } from '../../common/middleware/auth.js';
import { checkRevocation } from '../../common/middleware/checkRevocation.js';
import { uploadSingle, handleUploadError } from '../../common/middleware/upload.js';

router.use(authenticate as any);

// Worknotes
router.get('/worknotes', collaborationController.getWorknotes);
router.post('/worknotes', checkRevocation, collaborationController.addWorknote);
router.post('/upload', checkRevocation, uploadSingle, handleUploadError, collaborationController.uploadWorknoteAttachment);

// Participants
router.post('/participants', collaborationController.addParticipant);
router.delete('/participants/:id', collaborationController.removeParticipant);

export default router;
