<?php

declare(strict_types=1);

use App\Controllers\AdminAdmissionController;
use App\Controllers\AdminAuthController;
use App\Controllers\AdminDiagnosticsController;
use App\Controllers\AdminUserController;
use App\Controllers\AdmissionController;
use Core\Router;

return static function (Router $router): void {
    $router->get('/', [AdmissionController::class, 'create']);
    $router->post('/admissoes', [AdmissionController::class, 'store']);
    $router->get('/admissoes/documentos', [AdmissionController::class, 'documents']);
    $router->post('/admissoes/documentos/enviar', [AdmissionController::class, 'storeDocument']);
    $router->post('/admissoes/documentos/concluir', [AdmissionController::class, 'completeDocuments']);
    $router->get('/admissoes/foto-perfil', [AdmissionController::class, 'profilePhoto']);
    $router->post('/admissoes/foto-perfil', [AdmissionController::class, 'storeProfilePhoto']);
    $router->get('/obrigado', [AdmissionController::class, 'success']);

    $router->get('/admin/login', [AdminAuthController::class, 'login']);
    $router->post('/admin/login', [AdminAuthController::class, 'authenticate']);
    $router->get('/admin/logout', [AdminAuthController::class, 'logout']);
    $router->get('/admin/diagnostico', [AdminDiagnosticsController::class, 'index']);

    $router->get('/admin/usuarios', [AdminUserController::class, 'index']);
    $router->get('/admin/usuarios/novo', [AdminUserController::class, 'create']);
    $router->post('/admin/usuarios', [AdminUserController::class, 'store']);
    $router->get('/admin/usuarios/{id}/editar', [AdminUserController::class, 'edit']);
    $router->post('/admin/usuarios/{id}/editar', [AdminUserController::class, 'update']);
    $router->post('/admin/usuarios/{id}/status', [AdminUserController::class, 'toggleStatus']);

    $router->get('/admin/admissoes', [AdminAdmissionController::class, 'index']);
    $router->get('/admin/admissoes/{id}', [AdminAdmissionController::class, 'show']);
    $router->get('/admin/admissoes/{id}/editar', [AdminAdmissionController::class, 'edit']);
    $router->post('/admin/admissoes/{id}/editar', [AdminAdmissionController::class, 'update']);
    $router->get('/admin/admissoes/{id}/imprimir', [AdminAdmissionController::class, 'print']);
    $router->get('/admin/admissoes/{id}/pdf', [AdminAdmissionController::class, 'pdf']);
    $router->post('/admin/admissoes/{id}/status', [AdminAdmissionController::class, 'updateStatus']);
    $router->get('/admin/admissoes/{id}/excluir', [AdminAdmissionController::class, 'confirmDestroy']);
    $router->post('/admin/admissoes/{id}/excluir', [AdminAdmissionController::class, 'destroy']);
    $router->get('/admin/admissoes/{id}/anexos/{attachmentId}/visualizar', [AdminAdmissionController::class, 'previewAttachment']);
    $router->get('/admin/admissoes/{id}/anexos/{attachmentId}/download', [AdminAdmissionController::class, 'downloadAttachment']);
};
