Fix daily_summary dan hourly_summary aggregation, tambah fallback logic untuk dashboard, update validator untuk camera dan location type
This commit is contained in:
63
bin/test_routes.php
Normal file
63
bin/test_routes.php
Normal file
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
require __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
use App\Bootstrap\AppBootstrap;
|
||||
use App\Config\AppConfig;
|
||||
use App\Modules\Health\HealthRoutes;
|
||||
use App\Modules\Auth\AuthRoutes;
|
||||
use App\Modules\Retribusi\RetribusiRoutes;
|
||||
use App\Modules\Retribusi\Summary\SummaryRoutes;
|
||||
use App\Modules\Retribusi\Dashboard\DashboardRoutes;
|
||||
use App\Modules\Retribusi\Realtime\RealtimeRoutes;
|
||||
|
||||
AppConfig::loadEnv(__DIR__ . '/..');
|
||||
$app = AppBootstrap::create();
|
||||
|
||||
// Register routes
|
||||
HealthRoutes::register($app);
|
||||
AuthRoutes::register($app);
|
||||
RetribusiRoutes::register($app);
|
||||
SummaryRoutes::register($app);
|
||||
DashboardRoutes::register($app);
|
||||
RealtimeRoutes::register($app);
|
||||
|
||||
// Get all routes
|
||||
$routes = [];
|
||||
foreach ($app->getRouteCollector()->getRoutes() as $route) {
|
||||
foreach ($route->getMethods() as $method) {
|
||||
$routes[] = [
|
||||
'method' => $method,
|
||||
'pattern' => $route->getPattern()
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
echo "=== Registered Routes ===\n\n";
|
||||
foreach ($routes as $route) {
|
||||
echo "{$route['method']} {$route['pattern']}\n";
|
||||
}
|
||||
|
||||
echo "\n=== Testing Specific Routes ===\n";
|
||||
$testRoutes = [
|
||||
'/health',
|
||||
'/auth/v1/login',
|
||||
'/retribusi/v1/frontend/locations',
|
||||
'/retribusi/v1/dashboard/summary',
|
||||
'/retribusi/v1/dashboard/daily',
|
||||
'/retribusi/v1/realtime/snapshot',
|
||||
];
|
||||
|
||||
foreach ($testRoutes as $testRoute) {
|
||||
$found = false;
|
||||
foreach ($routes as $route) {
|
||||
// Simple pattern matching
|
||||
$pattern = str_replace(['{', '}'], ['', ''], $route['pattern']);
|
||||
if (strpos($testRoute, $pattern) === 0 || $route['pattern'] === $testRoute) {
|
||||
$found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
echo ($found ? '✅' : '❌') . " {$testRoute}\n";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user