<?php

use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\HomeController;
use App\Http\Controllers\UserController;
use App\Http\Controllers\ProtocoloController;
use App\Http\Controllers\RelatorioController;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    $rC = new RelatorioController();
    $dados = $rC->statusSolicitacoes();

    return view('auth.login', compact('dados'));
});

//Tutorial de como achar o id telegram
Route::get('/telegram', function () {
    return view('telegram');
});


//Rotas de teste (Apagar quando lançar o sistema ).
Route::get('/teste', function () {
    return view('teste');
});


Auth::routes();

Route::get('/home', [App\Http\Controllers\HomeController::class, 'index'])->name('home');

//cadastrador
Route::get('/cadastrador/home', [App\Http\Controllers\UserController::class, 'homeCadastrador'])->name('cadastrador.home');
Route::get('/cadastrador/solicitacoes', [App\Http\Controllers\ProtocoloController::class, 'index'])->name('cadastrador.solicitacoes');

//funcionario
Route::get('/funcionario/home', [App\Http\Controllers\UserController::class, 'homeFuncionario'])->name('funcionario.home');
Route::get('/funcionario/index/', [App\Http\Controllers\UserController::class, 'indexFuncionario'])->name('funcionario.index');
Route::get('/funcionario/create', [App\Http\Controllers\UserController::class, 'createFuncionario'])->name('funcionario.create');
Route::post('/funcionario/store', [App\Http\Controllers\UserController::class, 'storeFuncionario'])->name('funcionario.store');
Route::get('/funcionario/edit/{id}', [App\Http\Controllers\UserController::class, 'editFuncionario'])->name('funcionario.edit');
Route::post('/funcionario/update', [App\Http\Controllers\UserController::class, 'updateFuncionario'])->name('funcionario.update');
Route::get('/funcionario/destroy/{id}', [App\Http\Controllers\UserController::class, 'destroyFuncionario'])->name('funcionario.destroy');
Route::get('/funcionario/{id}', [App\Http\Controllers\UserController::class, 'showFuncionario'])->name('funcionario.show');

//solicitante
Route::get('/solicitante/index/', [App\Http\Controllers\UserController::class, 'indexSolicitante'])->name('solicitante.index');
Route::get('/solicitante/create', [App\Http\Controllers\UserController::class, 'createSolicitante'])->name('solicitante.create');
Route::post('/solicitante/store', [App\Http\Controllers\UserController::class, 'storeSolicitante'])->name('solicitante.store');
Route::get('/solicitante/edit/{id}', [App\Http\Controllers\UserController::class, 'editSolicitante'])->name('solicitante.edit');
Route::post('/solicitante/update', [App\Http\Controllers\UserController::class, 'updateSolicitante'])->name('solicitante.update');
Route::get('/solicitante/destroy/{id}', [App\Http\Controllers\UserController::class, 'destroySolicitante'])->name('solicitante.destroy');
Route::get('/solicitante/{id}', [App\Http\Controllers\UserController::class, 'showSolicitante'])->name('solicitante.show');

//protocolo
Route::resource('/protocolo', 'App\Http\Controllers\ProtocoloController');
Route::get('/protocolo/create', [App\Http\Controllers\ProtocoloController::class, 'create'])->name('protocolo.create');
Route::get('/protocoloMinhasSolicitacoes', [App\Http\Controllers\ProtocoloController::class, 'indexMinhasSolicitacoes'])->name('protocolo.minhasSolicitacoes');
Route::post('/protocoloUpdateSetor', [App\Http\Controllers\ProtocoloController::class, 'updateSetor'])->name('protocolo.updateSetor');
Route::get('/formularioAnonimo', [App\Http\Controllers\AnonimoController::class, 'index'])->name('indexAnonimo');
Route::post('/storeAnonima', [App\Http\Controllers\AnonimoController::class, 'storeAnonima'])->name('protocolo.storeAnonimo');

//acompanhamento
Route::post('/acompanhamento/armazena', [App\Http\Controllers\AcompanhamentoController::class, 'store']);

//acompanhamentos
Route::get('/relatorios', [App\Http\Controllers\RelatorioController::class, 'relatorios'])->name('relatorios');
Route::get('/index', [App\Http\Controllers\ProtocoloController::class, 'index2'])->name('index');

//setor
Route::resource('setor/setor', 'App\Http\Controllers\SetorController');

