<?php

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

Route::get('/schedules',                       [ScheduleController::class, 'index'])->middleware('permission:config.schedule,view');
Route::get('/schedules/grouped-by-client',     [ScheduleController::class, 'groupedByClient'])->middleware('permission:config.schedule,view');
Route::get('/schedules/finished',              [ScheduleController::class, 'finished'])->middleware('permission:config.schedule,view');
Route::get('/schedule/client-provider-blocks', [ScheduleController::class, 'clientProviderBlocks'])->middleware('permission:config.schedule,add');
Route::get('/schedule/{id}',                   [ScheduleController::class, 'show'])->middleware('permission:config.schedule,view');
Route::post('/schedule',                       [ScheduleController::class, 'store'])->middleware('permission:config.schedule,add');
Route::put('/schedule/{id}',                   [ScheduleController::class, 'update'])->middleware('permission:config.schedule,edit');
Route::patch('/schedule/{id}/status',          [ScheduleController::class, 'updateStatus'])->middleware('permission:config.schedule,edit');
Route::patch('/schedule/{id}/cancel',          [ScheduleController::class, 'cancelWithReason'])->middleware('permission:config.schedule,edit');
Route::delete('/schedule/{id}',                [ScheduleController::class, 'destroy'])->middleware('permission:config.schedule,delete');
