import { Router } from 'express';
import StudentController from '../controllers/StudentController';
import { authMiddleware } from '../../../middleware/auth';
import { singleUpload, handleUploadError } from '../middleware/upload';

const router = Router();

router.use(authMiddleware);

router.get('/profile', StudentController.getProfile);
router.put('/profile', StudentController.updateProfile);
router.get('/education', StudentController.getEducation);
router.put('/education', StudentController.updateEducation);
router.post('/documents/upload', singleUpload('file'), handleUploadError, StudentController.uploadDocument);
router.get('/documents', StudentController.getDocuments);
router.delete('/documents/:type', StudentController.deleteDocument);
router.put('/submit', StudentController.submit);
router.get('/status', StudentController.getStatus);
router.get('/notifications', StudentController.getNotifications);
router.put('/notifications/:id/read', StudentController.markNotificationRead);
router.get('/payments', StudentController.getPayments);
router.post('/chat/send', StudentController.sendMessage);
router.get('/chat/:receiverId', StudentController.getChat);

export default router;
