<?php
declare(strict_types=1);
$source=file_get_contents(__DIR__.'/../shared/api/module.php');
if(!preg_match('/\$key=(match\(true\)\{.*?\});/s',$source,$m))throw new RuntimeException('Module routing missing');
foreach(['department-management'=>'departments','manage-all-students'=>'students','file-management'=>'files'] as $module=>$expected){$actual=eval('return '.$m[1].';');if($actual!==$expected)throw new RuntimeException('Wrong route: '.$module);}
if(!preg_match('/\x27departments\x27=>\["(SELECT [^"]+)",\[\]\]/',$source,$m))throw new RuntimeException('Department query missing');
echo $m[1];
