const express = require('express');
const router = express.Router();
const GroupContactController = require('../controllers/groupContactController');
const { authenticateToken } = require('../middleware/auth');
// All routes require authentication
router.use(authenticateToken);
// GET /api/group-contacts/mappings/all - Get all mappings (MUST be before /:id)
router.get('/mappings/all', GroupContactController.getAllMappings);
// GET /api/group-contacts - Get all group contacts
router.get('/', GroupContactController.getAllGroupContacts);
// GET /api/group-contacts/:id - Get group contact by ID
router.get('/:id', GroupContactController.getGroupContactById);
// POST /api/group-contacts - Create group contact
router.post('/', GroupContactController.createGroupContact);
// POST /api/group-contacts/sync - Sync mappings for a department
router.post('/sync', GroupContactController.syncGroupContacts);
// GET /api/group-contacts/tree - Department-based contact tree
router.get('/tree', GroupContactController.getDepartmentContactTree);
// PUT /api/group-contacts/:id - Update group contact
router.put('/:id', GroupContactController.updateGroupContact);
// DELETE /api/group-contacts/:id - Delete group contact
router.delete('/:id', GroupContactController.deleteGroupContact);
module.exports = router;
//# sourceMappingURL=groupContacts.js.map