<?php

use App\Http\Controllers\Admin\BasciConfigurationController;
use App\Http\Controllers\Admin\ConfigurationSettingsController;
use App\Http\Controllers\Admin\ContactController;
use App\Http\Controllers\Admin\CreditConfigurationController;
use App\Http\Controllers\Admin\DashboardController;
use App\Http\Controllers\Admin\FrontendSettingController;
use App\Http\Controllers\Admin\GeneralSettingsController;
use App\Http\Controllers\Admin\MultiLanguageController;
use App\Http\Controllers\Admin\OpenAiConfigurationController;
use App\Http\Controllers\Admin\OrderController;
use App\Http\Controllers\Admin\PackageController;
use App\Http\Controllers\Admin\PaymentGatewayController;
use App\Http\Controllers\Admin\ProfileSettingsController;
use App\Http\Controllers\Admin\SubscriberController;
use App\Http\Controllers\Admin\SupportTicketController;
use App\Http\Controllers\Admin\UserController;
use App\Http\Controllers\Admin\VersionUpdateController;
use App\Http\Controllers\AppNotificationController;
use App\Http\Controllers\FrontendController;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider and all of them will
| be assigned to the "web" middleware group. Make something great!
|
*/


Route::get('/dashboard', [DashboardController::class, 'index'])->name('dashboard');
Route::group(['prefix' => 'settings', 'as' => 'settings.'], function () {
    Route::post('/basic-configuration', [BasciConfigurationController::class, 'basicConfiguration'])->name('basic.configuration');
    Route::group(['prefix' => 'configuration', 'as' => 'configuration.'], function () {
        Route::get('/', [ConfigurationSettingsController::class, 'index'])->name('index');
        Route::post('/google-configuration', [ConfigurationSettingsController::class, 'storeGoogleConfiguration'])->name('google');
        Route::post('/facebook-configuration', [ConfigurationSettingsController::class, 'storeFacebookConfiguration'])->name('facebook');
        Route::post('/recaptcha-configuration', [ConfigurationSettingsController::class, 'storeRecaptchaConfiguration'])->name('recaptcha');
        Route::post('/email-configuration', [ConfigurationSettingsController::class, 'storeEmailConfiguration'])->name('email');
        Route::post('/app-configuration', [ConfigurationSettingsController::class, 'storeAppConfiguration'])->name('app');
    });
    Route::group(['prefix' => 'general-settings', 'as' => 'general-settings.'], function () {
        Route::get('/', [GeneralSettingsController::class, 'index'])->name('index');
        Route::post('/store', [GeneralSettingsController::class, 'store'])->name('store');
    });
    Route::group(['prefix' => 'profile-settings', 'as' => 'profile-settings.'], function () {
        Route::get('/', [ProfileSettingsController::class, 'index'])->name('index');
        Route::post('/update', [ProfileSettingsController::class, 'update'])->name('update');
        Route::post('/password-update', [ProfileSettingsController::class, 'passwordUpdate'])->name('password.update');
    });

    Route::group(['prefix' => 'multi-language', 'as' => 'multi-language.'], function () {
        Route::get('/', [MultiLanguageController::class, 'index'])->name('index');
        Route::get('/get-data', [MultiLanguageController::class, 'getData'])->name('getData');
        Route::get('/edit', [MultiLanguageController::class, 'edit'])->name('edit');
        Route::post('/store', [MultiLanguageController::class, 'store'])->name('store');
        Route::post('/update', [MultiLanguageController::class, 'update'])->name('update');
        Route::get('/delete/{id}', [MultiLanguageController::class, 'delete'])->name('delete');
        Route::get('/trans', [MultiLanguageController::class, 'transList'])->name('trans');
        Route::get('/trans/update', [MultiLanguageController::class, 'transUpdate'])->name('trans.update');
    });
    Route::group(['prefix' => 'payment-gateway', 'as' => 'payment-gateway.'], function () {
        Route::get('/', [PaymentGatewayController::class, 'index'])->name('index');
        Route::get('/get-data', [PaymentGatewayController::class, 'getData'])->name('getData');
        Route::get('/edit', [PaymentGatewayController::class, 'edit'])->name('edit');
        Route::post('/update', [PaymentGatewayController::class, 'update'])->name('update');
    });
    Route::group(['prefix' => 'open-ai', 'as' => 'open-ai.'], function () {
        Route::get('/', [OpenAiConfigurationController::class, 'index'])->name('index');
        Route::post('/update', [OpenAiConfigurationController::class, 'update'])->name('update');
    });
    Route::group(['prefix' => 'credit-configuration', 'as' => 'credit-configuration.'], function () {
        Route::get('/', [CreditConfigurationController::class, 'index'])->name('index');
        Route::post('/update', [CreditConfigurationController::class, 'update'])->name('update');
    });
});
Route::group(['prefix' => 'users', 'as' => 'users.'], function () {
    Route::get('/', [UserController::class, 'index'])->name('index');
    Route::get('/view/{id}', [UserController::class, 'view'])->name('view');
    Route::get('/delete/{id}', [UserController::class, 'delete'])->name('delete');
    Route::post('/save-user', [UserController::class, 'saveUser'])->name('save');
    Route::get('/edit-user',[UserController::class, 'editUser'])->name('edit');
});

Route::group(['prefix' => 'package', 'as' => 'package.'], function () {
    Route::get('/', [PackageController::class, 'index'])->name('index');
    Route::post('/store', [PackageController::class, 'store'])->name('store');
    Route::get('/edit', [PackageController::class, 'edit'])->name('edit');
    Route::post('/update', [PackageController::class, 'update'])->name('update');
    Route::get('/delete/{id}', [PackageController::class, 'delete'])->name('delete');
});
Route::group(['prefix' => 'orders', 'as' => 'orders.'], function () {
    Route::get('/', [OrderController::class, 'index'])->name('index');
    Route::get('/get-data', [OrderController::class, 'getDataByStatus'])->name('getDataByStatus');
    Route::post('/status', [OrderController::class, 'updateStatus'])->name('status');
    Route::get('/view', [OrderController::class, 'view'])->name('view');
});
Route::group(['prefix' => 'subscribers', 'as' => 'subscribers.'], function () {
    Route::get('/', [SubscriberController::class, 'index'])->name('index');
    Route::get('/get-data', [SubscriberController::class, 'getDataByStatus'])->name('getData');
    Route::post('/status', [SubscriberController::class, 'status'])->name('status');
    Route::get('/view', [SubscriberController::class, 'view'])->name('view');
    Route::post('/sent-email', [SubscriberController::class, 'sentEmail'])->name('sentEmail');
});
Route::group(['prefix' => 'ticket', 'as' => 'ticket.'], function () {
    Route::get('/', [SupportTicketController::class, 'index'])->name('index');
    Route::get('/get-data', [SupportTicketController::class, 'getData'])->name('getData');
    Route::get('/view/{id}', [SupportTicketController::class, 'view'])->name('view');
    Route::post('/reply', [SupportTicketController::class, 'reply'])->name('reply.store');
    Route::POST('/status', [SupportTicketController::class, 'status'])->name('status');
    Route::get('/delete/{id}', [SupportTicketController::class, 'delete'])->name('delete');
    Route::get('/reply-delete',[SupportTicketController::class, 'replyDelete'])->name('reply.delete');
});
Route::group(['prefix' => 'notification', 'as' => 'notification.'], function () {
    Route::get('/', [AppNotificationController::class, 'index'])->name('index');
    Route::post('/update-notification', [AppNotificationController::class, 'updateNotification'])->name('update.notification');
});
Route::get('/ticket-chart-data', [DashboardController::class, 'getChartData'])->name('ticket.chart');
Route::get('/subscriber-chart-data', [DashboardController::class, 'subscriberChart'])->name('subscriber.chart');
Route::group(['prefix' => 'frontend', 'as' => 'frontend.'], function () {
    Route::get('/hero-section', [FrontendSettingController::class, 'heroSection'])->name('hero.section');
    Route::post('/hero-section-update', [FrontendSettingController::class, 'updateHeroSection'])->name('update.hero.section');
    Route::get('/about-section', [FrontendSettingController::class, 'aboutSection'])->name('about.section');
    Route::post('/about-section-update', [FrontendSettingController::class, 'updateAboutSection'])->name('update.about.section');
    Route::get('/feature-section', [FrontendSettingController::class, 'featureSection'])->name('feature.section');
    Route::post('/main-feature-update', [FrontendSettingController::class, 'updateMainFeatureSection'])->name('update.main.feature.section');
    Route::post('/main-feature-item', [FrontendSettingController::class, 'mainFeatureItem'])->name('main.feature.item');
    Route::get('/main-feature-item-edit', [FrontendSettingController::class, 'mainFeatureItemEdit'])->name('main.feature.item.edit');
    Route::post('/main-feature-item-update', [FrontendSettingController::class, 'mainFeatureItemUpdate'])->name('main.feature.item.update');
    Route::get('/main-feature-item-delete/{id}', [FrontendSettingController::class, 'mainFeatureItemDelete'])->name('main.feature.item.delete');
    Route::post('/embedded-feature-update', [FrontendSettingController::class, 'updateEmbeddedFeature'])->name('embedded.feature.update');
    Route::post('/playground-feature-update', [FrontendSettingController::class, 'updatePlaygroundFeature'])->name('playground.feature.update');
    Route::post('/playground-feature-item-update', [FrontendSettingController::class, 'updatePlaygroundFeatureItem'])->name('playground.feature.item.update');
    Route::post('/customize-feature-item-update', [FrontendSettingController::class, 'customizeFeatureItemUpdate'])->name('customize.feature.item.update');
    Route::post('/ai-support-feature-update', [FrontendSettingController::class, 'aiSupportFeatureUpdate'])->name('ai.support.feature.update');
    Route::get('/ai-support-feature-get-item', [FrontendSettingController::class, 'aiSupportFeatureGetItem'])->name('ai.support.feature.get.item');
    Route::get('/ai-support-feature-item-edit', [FrontendSettingController::class, 'aiSupportFeatureItemEdit'])->name('ai.support.feature.item.edit');
    Route::post('/ai-support-feature-item', [FrontendSettingController::class, 'aiSupportFeatureItem'])->name('ai.support.feature.item');
    Route::get('/ai-support-feature-item-delete/{id}', [FrontendSettingController::class, 'aiSupportFeatureItemDelete'])->name('ai.support.feature.item.delete');
    Route::post('/ai-support-feature-item-update', [FrontendSettingController::class, 'aiSupportFeatureItemUpdate'])->name('ai.support.feature.item.update');
    Route::get('/pricing-section', [FrontendSettingController::class, 'pricingSection'])->name('pricing.section');
    Route::post('/pricing-section-update', [FrontendSettingController::class, 'updatePricingSection'])->name('update.pricing.section');
    Route::get('/blog-section', [FrontendSettingController::class, 'blogSection'])->name('blog.section');
    Route::post('/blog-section-update', [FrontendSettingController::class, 'updateBlogSection'])->name('update.blog.section');
    Route::get('/lets-go-section', [FrontendSettingController::class, 'letsGoSection'])->name('lets.go.section');
    Route::post('/lets-go-section-update', [FrontendSettingController::class, 'updateLetsGoSection'])->name('update.lets.go.section');
    Route::get('/lets-talk-section', [FrontendSettingController::class, 'letsTalkSection'])->name('lets.talk.section');
    Route::post('/lets-talk-section-update', [FrontendSettingController::class, 'updateLetsTalkSection'])->name('update.lets.talk.section');
    Route::get('/add-blog', [FrontendSettingController::class, 'addBlog'])->name('add.blog');
    Route::post('/store-blog', [FrontendSettingController::class, 'storeBlog'])->name('store.blog');
    Route::get('/blog-edit/{id}', [FrontendSettingController::class, 'editBlog'])->name('blog.edit');
    Route::get('/blog-delete/{id}', [FrontendSettingController::class, 'deleteBlog'])->name('blog.delete');
    Route::get('/terms-condition', [FrontendSettingController::class, 'termsCondition'])->name('terms.condition');
    Route::post('/store-terms-condition', [FrontendSettingController::class, 'storeTermsCondition'])->name('store.terms.condition');
    Route::get('/privacy-policy', [FrontendSettingController::class, 'privacyPolicy'])->name('privacy.policy');
    Route::post('/store-privacy-policy', [FrontendSettingController::class, 'storePrivacyPolicy'])->name('store.privacy.policy');
});

Route::group(['prefix' => 'contact', 'as' => 'contact.'], function () {
    Route::get('/list', [ContactController::class, 'contactList'])->name('list');
    Route::get('/view', [ContactController::class, 'view'])->name('view');
    Route::get('/delete/{id}', [ContactController::class, 'delete'])->name('delete');
});

Route::group(['prefix' => 'version', 'as' => 'version.'], function () {
    Route::get('/', [VersionUpdateController::class, 'index'])->name('index');
    Route::post('/process', [VersionUpdateController::class, 'process'])->name('process');
});
