<?php
declare(strict_types=1);

use App\Controllers\AuthController;
use App\Controllers\HomeController;
use App\Controllers\PortalController;
use App\Core\Router;

return static function (Router $r): void {
    $r->get('/login', [AuthController::class, 'showLogin'], false);
    $r->post('/login', [AuthController::class, 'login'], false);
    $r->get('/logout', [AuthController::class, 'logout'], true);

    $r->get('/', [HomeController::class, 'index']);
    $r->get('/home', [HomeController::class, 'index']);

    $r->get('/invoices', [PortalController::class, 'invoices']);
    $r->get('/invoices/{id}/file', [PortalController::class, 'invoiceFile']);
    $r->get('/documents', [PortalController::class, 'documents']);
    $r->get('/documents/{id}/file', [PortalController::class, 'file']);
    $r->get('/documents/{id}/signed', [PortalController::class, 'signed']);
    $r->get('/sign', [PortalController::class, 'sign']);
    $r->post('/sign/{id}', [PortalController::class, 'signSave']);
    $r->get('/orders', [PortalController::class, 'orders']);
    $r->get('/contract', [PortalController::class, 'contract']);
    $r->get('/contract/{id}/file', [PortalController::class, 'contractFile']);
    $r->get('/equipment', [PortalController::class, 'equipment']);
    $r->get('/service', [PortalController::class, 'service']);
    $r->post('/service', [PortalController::class, 'serviceSave']);
};
