<?php
require_once '../config.php';
require_once '../../includes/Auth.php';
require_once '../../includes/Notification.php';

$auth = new Auth();
$user = $auth->requireAuth();

$notification = new Notification();

if ($_SERVER['REQUEST_METHOD'] === 'GET') {
    try {
        $notifications = $notification->getUnread($user['id']);
        jsonResponse(['success' => true, 'notifications' => $notifications]);
    } catch (Exception $e) {
        jsonResponse(['success' => false, 'message' => $e->getMessage()], 500);
    }
}
?>