<?php

use App\Http\Controllers\Install\InstallController;
use App\Http\Controllers\Install\MigrateStreamController;
use Illuminate\Support\Facades\Route;

Route::prefix('install')
    ->middleware(['installer.only', 'throttle:installer'])
    ->name('install.')
    ->group(function () {
        Route::get('/', [InstallController::class, 'index'])->name('index');

        Route::post('/stage1/check', [InstallController::class, 'stage1Check'])->name('stage1.check');
        Route::post('/stage2/db', [InstallController::class, 'stage2Db'])->name('stage2.db');
        Route::post('/stage3/admin', [InstallController::class, 'stage3Admin'])->name('stage3.admin');
        Route::post('/stage4/migrate', [InstallController::class, 'stage4Migrate'])->name('stage4.migrate');
        Route::get('/stage4/stream/{token}', [MigrateStreamController::class, 'stream'])->name('stage4.stream');
        Route::post('/stage5/finish', [InstallController::class, 'stage5Finish'])->name('stage5.finish');

        // GAP-15: 설치 보고서 다운로드 (1회용 토큰)
        Route::get('/report/{token}', [InstallController::class, 'report'])->name('report');
    });
