<?php

use Illuminate\Support\Facades\Route;
use App\Http\Controllers\Endline\EndlineController;

// Route::get('/', function () {
//     return view('welcome');
// });

Route::redirect('/', '/endline');



Route::prefix('endline')->name('endline.')->group(function () {

    Route::get('/', [EndlineController::class, 'endline'])->name('home');

	Route::get('/logout', [EndlineController::class, 'logout'])->name('logout');

    Route::get('/tablepage', [EndlineController::class, 'endline_tablepage'])
        ->name('tablepage');

    Route::get('/linetable', [EndlineController::class, 'endlinetablepage'])
        ->name('linetable');

    Route::get('/tablepagebeta1', [EndlineController::class, 'endline_tablepagebeta1'])
        ->name('tablepagebeta1');    

    Route::get('/selection', [EndlineController::class, 'endline_selection'])
        ->name('selection');

    Route::get('/defectselection', [EndlineController::class, 'endline_defectselection'])
        ->name('defectselection');

    Route::get('/finalselection', [EndlineController::class, 'endline_finalselection'])
        ->name('finalselection');

    Route::get('/checker_details', [EndlineController::class, 'checkerDetails'])
        ->name('checker_details');

    Route::get('/logout', [EndlineController::class, 'logout'])
        ->name('logout');

    Route::get('/get_defect_list', [EndlineController::class, 'get_defect_list'])
        ->name('get_defect_list');    

        

});

Route::get('/convert-rfid-prod', [EndlineController::class, 'convertRFIDtoEAN']);
Route::get('/convert-rfid-prod-test', [EndlineController::class, 'convertRFIDtoEAN_test']);
Route::get('/updateDefectCode', [EndlineController::class, 'updateDefectCode']);
Route::post('/endline_pass', [EndlineController::class, 'endline_pass']);

Route::post('/rfid-save', [EndlineController::class, 'bundelCheckStatus'])->name('rfid-save');

Route::get('/clear-route-cache', function () {
    Artisan::call('route:clear');
  
    Artisan::call('config:clear');
    Artisan::call('view:clear');
   

    return response()->json(['message' => 'Route cache cleared successfully']);
});

Route::get('/defect_save', [EndlineController::class, 'defect_save'])->name('defect_save');
Route::get('/gut_unitdetails', [EndlineController::class, 'unitDetails'])->name('gut.unitdetails'); 
Route::get('/gut_linedetails', [EndlineController::class, 'lineDetails'])->name('gut.linedetails'); 