<?php

namespace Modules\UX;

use Gestoreasy\Core\Module\ModuleInterface;
use Gestoreasy\Core\Routing\Router;
use Gestoreasy\Core\Http\AuthMiddleware;
use Gestoreasy\Core\Auth\Rbac;
use Modules\UX\Controllers\BuscaGlobalController;
use Modules\UX\Controllers\OnboardingController;
use Modules\UX\Controllers\AtalhosController;
use Modules\UX\Controllers\UXViewsController;

class Module implements ModuleInterface {
    public function register(Router $router): void {
        $buscaCtrl = new BuscaGlobalController();
        $onboardingCtrl = new OnboardingController();
        $atalhosCtrl = new AtalhosController();
        $viewsCtrl = new UXViewsController();

        // API - Busca Global
        $router->get('/api/busca-global', [$buscaCtrl, 'buscar'], [AuthMiddleware::requireAuth()]);

        // API - Onboarding
        $router->get('/api/onboarding/status', [$onboardingCtrl, 'getStatus'], [AuthMiddleware::requireAuth()]);
        $router->post('/api/onboarding/completar-passo', [$onboardingCtrl, 'completarPasso'], [AuthMiddleware::requireAuth()]);
        $router->post('/api/onboarding/pular', [$onboardingCtrl, 'pular'], [AuthMiddleware::requireAuth()]);

        // API - Atalhos
        $router->get('/api/atalhos', [$atalhosCtrl, 'list'], [AuthMiddleware::requireAuth()]);
        $router->post('/api/atalhos', [$atalhosCtrl, 'create'], [AuthMiddleware::requireAuth()]);
        $router->delete('/api/atalhos/{id}', [$atalhosCtrl, 'delete'], [AuthMiddleware::requireAuth()]);
    }
}

