<?php

use Illuminate\Support\Facades\Route;
use App\Http\Controllers\DeclaracionController;

/*
|--------------------------------------------------------------------------
| Rutas SARLAFT
|--------------------------------------------------------------------------
*/

// Raíz → intro
Route::get('/', fn() => redirect()->route('declaracion.intro'));

// Página introductoria
Route::get('/intro',                [DeclaracionController::class, 'intro'])   ->name('declaracion.intro');

// Formulario de declaración
Route::get('/declaracion',          [DeclaracionController::class, 'index'])   ->name('declaracion.index');
Route::post('/declaracion',         [DeclaracionController::class, 'store'])   ->name('declaracion.store');
Route::get('/declaracion/enviada',  [DeclaracionController::class, 'success']) ->name('declaracion.success');
Route::get('/declaracion/pdf/{token}', [DeclaracionController::class, 'download'])->name('declaracion.download');
