<?php
require_once '../../engine/engine.php';

$symbol = $_GET['symbol'] ?? '';

if (!$symbol) {
	http_response_code(400);
	echo json_encode([]);
	exit;
}

$stmt = $pdo->prepare("SELECT rating_criteria FROM watchlist WHERE symbol = ? LIMIT 1");
$stmt->execute([$symbol]);

$data = $stmt->fetch();
echo json_encode($data && $data['rating_criteria'] ? json_decode($data['rating_criteria'], true) : []);
