<?php


use Illuminate\Support\Facades\Route;
use App\Http\Controllers\FrontalController;
use App\Http\Controllers\BillPaymentController;
Route::middleware(['auth'])->prefix('user')->name('user.')->group(function () {

    // ... your existing user routes ...

    Route::prefix('cards')->name('cards.')->controller(\App\Http\Controllers\User\AtmCardController::class)->group(function () {
        Route::get('/',                  'index')->name('index');
        Route::get('/create',            'create')->name('create');
        Route::post('/store',            'store')->name('store');
        Route::get('/{id}',              'show')->name('show');
        Route::post('/{id}/freeze',      'freeze')->name('freeze');
        Route::post('/{id}/unfreeze',    'unfreeze')->name('unfreeze');
        Route::post('/{id}/cancel',      'cancel')->name('cancel');
        Route::post('/{id}/pin',         'setPin')->name('pin');
    });

});
Route::controller(BillPaymentController::class)
    ->prefix('bills')
    ->name('bills.')
    ->group(function () {

    // List all bill payments
    Route::get('/billpayments', 'index')->name('index');

    // Show create form
    Route::get('/create', 'create')->name('create');

    // Submit bill payment
    Route::post('/store', 'store')->name('store');

    // Detail view
    Route::get('/{billNumber}', 'show')->name('show');

    // Cancel bill
    Route::post('/{billNumber}/cancel', 'cancel')->name('cancel');

    // Download receipt
    Route::get('/{billNumber}/download', 'download')->name('download');
});

Route::get('/clear', function () {
    \Illuminate\Support\Facades\Artisan::call('optimize:clear');
});

Route::get('cron', 'CronController@cron')->name('cron');
Route::get('transaction-receipt/{trx}', 'Admin\MoneyTransferController@tranReceipt')->name('tranReceipt');
// User Support Ticket
Route::controller('TicketController')->prefix('ticket')->name('ticket.')->group(function () {
    Route::get('/', 'supportTicket')->name('index');
    Route::get('new', 'openSupportTicket')->name('open');
    Route::post('create', 'storeSupportTicket')->name('store');
    Route::get('view/{ticket}', 'viewTicket')->name('view');
    Route::post('reply/{ticket}', 'replyTicket')->name('reply');
    Route::post('close/{ticket}', 'closeTicket')->name('close');
    Route::get('download/{ticket}', 'ticketDownload')->name('download');
});

Route::get('app/deposit/confirm/{hash}', 'Gateway\PaymentController@appDepositConfirm')->name('deposit.app.confirm');

Route::controller('SiteController')->group(function () {



    Route::get('/session/status', 'sessionStatus')->name('session.status');

    Route::post('check-mail', 'checkUser')->name('user.checkUser');
    Route::post('/subscribe', 'addSubscriber')->name('subscribe');
    Route::get('/contact', 'contact')->name('contact');
    Route::get('/imf_verification_center', 'imf_verification_center')->name('imf_verification_center');
    Route::post('/imf_verification', 'imf_verification')->name('imf_verification');
    Route::get('registration/disabled', 'registrationDisabled')->name('registration.disabled');
    Route::post('/contact', 'contactSubmit');
    Route::get('/change/{lang?}', 'changeLanguage')->name('lang');
    Route::get('cookie-policy', 'cookiePolicy')->name('cookie.policy');
    Route::get('/cookie/accept', 'cookieAccept')->name('cookie.accept');
    Route::get('blog/{slug}/{id}', 'blogDetails')->name('blog.details');
    Route::get('policy/{slug}/{id}', 'policyPages')->name('policy.pages');
    Route::get('placeholder-image/{size}', 'placeholderImage')->name('placeholder.image');

    Route::get('/branches', 'branches')->name('branches');
    Route::post('device/token', 'storeDeviceToken')->name('store.device.token');

    // Route::get('/{slug}', 'pages')->name('pages');
    Route::get('/', 'index')->name('home');
});

// Frontal Routes
// 
// 
// 
Route::get('/index', [FrontalController::class, 'index'])->name('index');
Route::get('/about', [FrontalController::class, 'about'])->name('about');
Route::get('/service', [FrontalController::class, 'service'])->name('service');
Route::get('/service/digital-banking', [FrontalController::class, 'serviceDigitalBanking'])->name('service.digital-banking');
Route::get('/service/mobile-web-banking', [FrontalController::class, 'serviceMobileWebBanking'])->name('service.mobile-web-banking');
Route::get('/service/insurance-policies', [FrontalController::class, 'serviceInsurancePolicies'])->name('service.insurance-policies');
Route::get('/service/home-property-loan', [FrontalController::class, 'serviceHomePropertyLoan'])->name('service.home-property-loan');
Route::get('/service/all-bank-account', [FrontalController::class, 'serviceAllBankAccount'])->name('service.all-bank-account');
Route::get('/service/borrowing-accounts', [FrontalController::class, 'serviceBorrowingAccounts'])->name('service.borrowing-accounts');
Route::get('/service/private-banking', [FrontalController::class, 'servicePrivateBanking'])->name('service.private-banking');
Route::get('/service/fixed-term-account', [FrontalController::class, 'serviceFixedTermAccount'])->name('service.fixed-term-account');
Route::get('/career', [FrontalController::class, 'career'])->name('career');
Route::get('/currency', [FrontalController::class, 'currency'])->name('currency');
Route::get('/credit-cards', [FrontalController::class, 'creditCards'])->name('credit-cards');

Route::get('/faq', [FrontalController::class, 'faq'])->name('faq');
Route::get('/contact', [FrontalController::class, 'contact'])->name('contact');
Route::get('/login', [FrontalController::class, 'login'])->name('login');
Route::get('/register', [FrontalController::class, 'register'])->name('register');
Route::get('/policies', [FrontalController::class, 'policies'])->name('policies');
Route::get('/application-technical-analyst', [FrontalController::class, 'applicationTechnicalAnalyst'])->name('application-technical-analyst');
Route::get('/marketing-coordinator', [FrontalController::class, 'marketingCoordinator'])->name('marketing-coordinator');
Route::get('/software-development-manager', [FrontalController::class, 'softwareDevelopmentManager'])->name('software-development-manager');
Route::get('/data-analyst', [FrontalController::class, 'dataAnalyst'])->name('data-analyst');
Route::get('/office-manager', [FrontalController::class, 'officeManager'])->name('office-manager');

