<?php

use App\Http\Controllers\Admin\DailyBranchReportController;
use Illuminate\Support\Facades\Route;

Route::middleware(['auth', 'permission:system.settings.manage'])
    ->prefix('admin')
    ->name('admin.')
    ->group(function (): void {
        Route::get('/daily-reports', [DailyBranchReportController::class, 'index'])->name('daily-reports.index');
        Route::put('/daily-reports/settings', [DailyBranchReportController::class, 'updateSettings'])->name('daily-reports.settings.update');
        Route::post('/daily-reports/recipients', [DailyBranchReportController::class, 'storeRecipient'])->name('daily-reports.recipients.store');
        Route::put('/daily-reports/recipients/{recipient}', [DailyBranchReportController::class, 'updateRecipient'])->name('daily-reports.recipients.update');
        Route::delete('/daily-reports/recipients/{recipient}', [DailyBranchReportController::class, 'destroyRecipient'])->name('daily-reports.recipients.destroy');
        Route::get('/daily-reports/{report}', [DailyBranchReportController::class, 'show'])->name('daily-reports.show');
        Route::post('/daily-reports/{report}/send', [DailyBranchReportController::class, 'send'])->name('daily-reports.send');
        Route::post('/daily-report-deliveries/{delivery}/retry', [DailyBranchReportController::class, 'retryDelivery'])->name('daily-reports.deliveries.retry');
    });
