import { Router } from 'express';
import {
  createPatientPortalAppointment,
  getPatientPortalDoctorSlots,
  getPatientPortalDoctors,
  getPatientPortalNotifications,
  getPatientPortalOverview,
  getPatientPortalProfile,
  readPatientPortalNotification,
  updatePatientPortalProfile,
} from '../controllers/patient-portal.controller';
import { requirePatientSession } from '../middleware/patient-auth.middleware';

const router = Router();

router.use(requirePatientSession);
router.get('/overview', getPatientPortalOverview);
router.get('/notifications', getPatientPortalNotifications);
router.post('/notifications/:notificationId/read', readPatientPortalNotification);
router.get('/profile', getPatientPortalProfile);
router.put('/profile', updatePatientPortalProfile);
router.get('/doctors', getPatientPortalDoctors);
router.get('/doctors/:doctorUserId/slots', getPatientPortalDoctorSlots);
router.post('/appointments', createPatientPortalAppointment);

export default router;
