<?php

use App\Http\Controllers\LaporanController;
use App\Http\Controllers\LoginController;
use App\Http\Controllers\MenuController;
use App\Http\Controllers\PembelanjaanController;
use App\Http\Controllers\SiteKaryawanController;
use App\Http\Controllers\TransaksiController;
use Illuminate\Support\Facades\Route;

Route::get('/', function () {
    return view('component.login');
});


// route login start
Route::get('/login',[LoginController::class, 'index'])
->name('login');

Route::get('/dashboard',[LoginController::class, 'masuk'])
->name('dashboard')
->middleware('auth');

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

Route::post('/login',[LoginController::class, 'authenticate'])
->name('enter-login');

// route login end




// Route grouping start


                    Route::get('/menu', [MenuController::class, 'index'])
                ->name('menu')
                ->middleware('auth');

                Route::get('/menu/daftar-menu/', [MenuController::class, 'DaftarMenu'])
                ->name('daftar-menu')
                ->middleware('auth');

                Route::get('/menu/form-tambah-menu', [MenuController::class, 'FormTambahMenu'])
                ->name('form-tambah-menu')
                ->middleware('auth');

                Route::get('menu/update-menu/{id}',[MenuController::class, 'UpdateMenu'])
                ->name('update-menu')
                ->middleware('auth');

                Route::post('menu/simpan-update-menu/{id}', [MenuController::class, 'SimpanUpdateMenu'])
                ->name('simpan-update-menu')
                ->middleware('auth');

                Route::post('menu/simpan-menu', [MenuController::class, 'SimpanMenu'])
                ->name('simpan-form-menu')
                ->middleware('auth');


                // route transaksi start

                Route::get('/transaksi', [TransaksiController::class, 'index'])
                ->name('transaksi')
                ->middleware('auth');

                Route::post('/transaksi/simpan', [TransaksiController::class, 'SimpanPesanan'])
                ->name('simpan-pesanan')
                ->middleware('auth');

                Route::get('/transaksi/pesanan/hapus/{id}', [TransaksiController::class, 'HapusTransaksi'])
                ->name('hapus-pesanan')
                ->middleware('auth');

                Route::get('/transaksi/list/hapus/{id}', [TransaksiController::class, 'HapusListTransaksi'])
                ->name('hapus-list-transaksi')
                ->middleware('auth');

                // route void transaksi start
                
                Route::get('/transaksi/void/{kode_pesanan}',[TransaksiController::class, 'VoidView'])
                ->name('voidView')
                ->middleware('auth');

                Route::get('/transaksi/void/delete/{id}',[TransaksiController::class, 'VoidDelete'])
                ->name('void-delete')
                ->middleware('auth');

                // route void transaksi end

                // Route::get('/transaksi/list/onprocess', [TransaksiController::class, 'ListTransaksiOnProcess'])
                // ->name('transaksi-on-process')
                // ->middleware('auth');


                Route::post('/transaksi/simpan-update-pesanan',[TransaksiController::class, 'SimpanUpdatePesanan'])
                ->name('simpan-update-pesanan')
                ->middleware('auth');

                Route::get('/transaksi/list/transaksi/lunas',[TransaksiController::class, 'ListTransaksiLunas'])
                ->name('list-transaksi-lunas')
                ->middleware('auth');

                Route::get('/transaksi/print/transaksi/{id}',[TransaksiController::class, 'PrintNotaTransaksi'])
                ->name('print-nota-transaksi')
                ->middleware('auth');

                Route::get('/transaksi/print/transaksi/kitchen/{id}',[TransaksiController::class, 'PrintNotaKitchen'])
                ->name('print-nota-kitchen')
                ->middleware('auth');

                Route::get('/transaksi/list/transaksi/update/status/{id}',[TransaksiController::class, 'UpdateStatusTransaksi'])
                ->name('statusListTransaksiUpdate')
                ->middleware('auth');

                Route::get('/transaksi/update/metode/pembayaran/{id}',[TransaksiController::class, 'UpdateMetodeBayar'])
                ->name('updatemetodebayar')
                ->middleware('auth');

                Route::post('/transaksi/update/metode/bayar/simpan{id}',[TransaksiController::class, 'SimpanUpdateMetodeBayar'])
                ->name('simpanupdatemetodebayar')
                ->middleware('auth');

                Route::post('/transaksi/lunas/status/bayar/simpan/{id}',[TransaksiController::class, 'TransaksiSimpanStatusBayar'])
                ->name('transaksiSimpanStatusBayar')
                ->middleware('auth');

                // Route transaksi tambah pesanan yang sudah ada start
                Route::get('/transaksi/tambah-transaksi-at-list-transaksi/{kode_pesanan}',[TransaksiController::class,'TambahTransaksiPadaListTransaksi'])
                ->name('TambahPesananPadaListTransaksi')
                ->middleware('auth');

                Route::post('/transaksi/simpan-transaksi-at-list-transaksi/{kode_pesanan}',[TransaksiController::class,'SimpanTransaksiPadaListTransaksi'])
                ->name('simpan-tambah-pesanan-at-list-transaksi')
                ->middleware('auth');
                // Route transaksi tambahan pesanan yang sudah ada end 
                // route transaksi end

                                
                // site karyawan start
                Route::get('/SiteKaryawan',[SiteKaryawanController::class, 'index'])
                ->name('site-karyawan')
                ->middleware('auth');
                // site karyawan end

                // start site pembelanjaan
                Route::get('/Pembelanjaan',[PembelanjaanController::class, 'index'])
                ->name('site-pembelanjaan')
                ->middleware('auth');

                Route::get('/Pembelanjaan/FormNotaBelanja',[PembelanjaanController::class, 'formNotaBelanja'])
                ->name('Form-Nota-Belanja')
                ->middleware('auth');

                // end site pembelanjaan 
                // Route Laporan start
                Route::get('/Laporan',[LaporanController::class, 'index'])
                ->name('laporan')
                ->middleware('auth');
                
                Route::get('/laporan/harian',[LaporanController::class, 'laporanHarian'])
                ->name('Laporan-Harian')
                ->middleware('auth');

                Route::get('/Laporan/bulanan',[LaporanController::class, 'laporanBulanan'])
                ->name('Laporan-Bulanan')
                ->middleware('auth');
                
                // Route Laporan end
// Route grouping end