<?php

use App\Http\Controllers\InstallController;
use App\Http\Controllers\InvoicePdfController;
use Illuminate\Support\Facades\Route;

// نصب‌کننده‌ی وب
Route::get('/install', [InstallController::class, 'show']);
Route::post('/install', [InstallController::class, 'install']);
Route::get('/install/done', [InstallController::class, 'done']);

Route::get('/', fn () => redirect('/admin'));

// صفحه‌ی چاپ فاکتور (نیازمند ورود)
Route::get('/invoices/{invoice}/print', [InvoicePdfController::class, 'print'])
    ->middleware('auth')
    ->name('invoices.print');

// خروجی اکسل تک‌فاکتور
Route::get('/invoices/{invoice}/excel', [InvoicePdfController::class, 'excel'])
    ->middleware('auth')
    ->name('invoices.excel');

// لینک اشتراکی عمومی فاکتور (با توکن)
Route::get('/invoices/share/{token}', [InvoicePdfController::class, 'share'])
    ->name('invoices.share');
