<?php

declare(strict_types=1);

use Illuminate\Support\Facades\Route;
use ImovelZapAi\Proposals\Presentation\Http\Controllers\Public\PublicProposalController;

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