<?php

namespace FleekDash\Routes\Groups;

use FleekDash\Controllers\RealtimeController;
use FleekDash\Libs\API\Route;
use FleekDash\Libs\API\RouteAuthMiddleware;

defined('ABSPATH') || exit;

class RealtimeRoutes
{
    public static function register(): void
    {
        $controller = new RealtimeController();

        Route::get('realtime/config', [$controller, 'getConfig'], RouteAuthMiddleware::authenticated());
        Route::post('realtime/dispatch-outbox', [$controller, 'dispatchOutbox'], RouteAuthMiddleware::admin());
        Route::post('realtime/test-event', [$controller, 'testEvent'], RouteAuthMiddleware::admin());
        Route::get('realtime/stats', [$controller, 'getStats'], RouteAuthMiddleware::admin());
        Route::post('realtime/config', [$controller, 'updateConfig'], RouteAuthMiddleware::admin());
    }
}

