<?php
require __DIR__ . '/standalone/bootstrap.php';
$base = 'http://127.0.0.1/acc-engine/api.php/acc/v1';
$ch = curl_init("$base/public/auth/login");
curl_setopt_array($ch, [CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => ['Content-Type: application/json'], CURLOPT_POSTFIELDS => json_encode(['username' => 'edu_student_konkur', 'password' => 'Edu@1404'])]);
$j = json_decode((string) curl_exec($ch), true);
curl_close($ch);
$t = $j['token'] ?? '';
$ch = curl_init("$base/education/companion/state");
curl_setopt_array($ch, [CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => ["Authorization: Bearer $t"]]);
$s = json_decode((string) curl_exec($ch), true);
curl_close($ch);
echo 'history=' . count($s['profile']['academic_history'] ?? []) . ' completeness=' . ($s['life_path']['completeness']['pct'] ?? 0) . PHP_EOL;
echo 'phases=' . count($s['life_path']['phases'] ?? []) . ' budget=' . ($s['life_path']['budget']['tier_label'] ?? '') . PHP_EOL;
