import express from 'express';
import {
    updateProfileSettings,
    updateCompanySettings,
    getCompanySettings,
    getProfileSettings,
    getMailSettings,
    updateMailSettings,
    createTitle,
    getTitle
} from '../controller/settingsController.js';
import { authenticateUser } from '../middleware/authMiddleware.js';
import { avatarUpload, logoUpload } from '../utils/multer.js';

const router = express.Router();

// Profile routes
router.get('/profile', authenticateUser, getProfileSettings);
router.put('/profile', authenticateUser, avatarUpload, updateProfileSettings);

// Company routes
router.get('/company', authenticateUser, getCompanySettings);
router.put('/company', authenticateUser, logoUpload, updateCompanySettings);

// Mail routes
router.get('/mail', authenticateUser, getMailSettings);
router.put('/mail', authenticateUser, updateMailSettings);

// Title route
router.put('/title', authenticateUser, createTitle);
router.get('/title', authenticateUser, getTitle);

export default router;
