<?php

declare(strict_types=1);

use Illuminate\Support\Facades\Route;
use ImovelZapAi\Documents\Presentation\Http\Controllers\Public\PublicDocumentController;

Route::middleware(['web', 'throttle:'.(int) config('documents.rate_limit_per_minute', 60).',1'])
    ->prefix('d')
    ->group(function (): void {
        Route::get('{token}', [PublicDocumentController::class, 'show'])->name('documents.public.show');
        Route::post('{token}/decide', [PublicDocumentController::class, 'decide'])->name('documents.public.decide');
        Route::post('{token}/heartbeat', [PublicDocumentController::class, 'heartbeat'])->name('documents.public.heartbeat');
        Route::get('{token}/pdf', [PublicDocumentController::class, 'pdf'])->name('documents.public.pdf');
    });
