<?php
require_once __DIR__ . '/../config/constants.php';
require_once __DIR__ . '/../config/database.php';
require_once __DIR__ . '/../includes/auth.php';

header('Content-Type: application/json');
startSecureSession();
if (!isLoggedIn()) { echo json_encode(['error'=>'Unauthorized']); exit; }

$sessionId = (int)($_GET['session_id'] ?? 0);
$pdo = db();
$pdo->prepare("UPDATE session_minutes SET finalized=1 WHERE session_id=?")->execute([$sessionId]);
echo json_encode(['success' => true]);
