<?php

use App\Modules\Operations\Controllers\OperationalControlCenterPageController;
use App\Modules\Operations\Controllers\OperationalControlEventAcknowledgeController;
use App\Modules\Operations\Controllers\OperationalControlInventoryActionController;
use App\Modules\Operations\Controllers\WorkflowInboxPageController;
use Illuminate\Support\Facades\Route;

Route::get('/operations/workflow-inbox', [WorkflowInboxPageController::class, 'index'])
    ->name('operations.workflow-inbox.index');

Route::prefix('operations/control-center')->name('operations.control-center.')->group(function (): void {
    Route::get('/', [OperationalControlCenterPageController::class, 'index'])
        ->middleware('can:operations.control.view')
        ->name('index');

    Route::post('/events/{operational_control_event}/acknowledge', [OperationalControlEventAcknowledgeController::class, 'store'])
        ->middleware('can:acknowledge,operational_control_event')
        ->name('events.acknowledge');

    Route::post('/inventory/rebuild', [OperationalControlInventoryActionController::class, 'rebuild'])
        ->middleware('can:operations.control.view')
        ->name('inventory.rebuild');

    Route::post('/inventory/reconcile-check', [OperationalControlInventoryActionController::class, 'reconcileCheck'])
        ->middleware('can:operations.control.view')
        ->name('inventory.reconcile-check');
});
