/**
 * Document Routes
 * Document API endpoints
 */

import { Router } from 'express';
import { DocumentController } from '../controllers/document.controller';
import { authenticate } from '../middleware/auth.middleware';

const router = Router();

/**
 * @route   POST /api/documents
 * @desc    Create a new document
 * @access  Private
 */
router.post('/', authenticate, DocumentController.create);

/**
 * @route   GET /api/documents
 * @desc    Get user documents
 * @access  Private
 */
router.get('/', authenticate, DocumentController.getUserDocuments);

/**
 * @route   GET /api/documents/:id
 * @desc    Get document by ID
 * @access  Private
 */
router.get('/:id', authenticate, DocumentController.getById);

/**
 * @route   PUT /api/documents/:id
 * @desc    Update document
 * @access  Private
 */
router.put('/:id', authenticate, DocumentController.update);

/**
 * @route   DELETE /api/documents/:id
 * @desc    Delete document
 * @access  Private
 */
router.delete('/:id', authenticate, DocumentController.delete);

export default router;
