<?php

use Illuminate\Support\Facades\Route;
use App\Http\Controllers\Backend\Company\LocationController;
use App\Http\Controllers\coreApp\Setting\IpConfigController;
use App\Http\Controllers\Backend\Company\CompanyConfigController;

Route::group(['prefix' => 'admin/company-setup', 'middleware' => ['xss','admin']], function () {


    //start company setup
    Route::get('/',                               [CompanyConfigController::class, 'index'])->name('company.settings.view')->middleware(['PermissionCheck:company_settings_read']);
    Route::post('update',                         [CompanyConfigController::class, 'update'])->name('company.settings.update')->middleware('PermissionCheck:configuration_update');
    Route::post('currencyInfo',                   [CompanyConfigController::class, 'currencyInfo'])->name('company.settings.currencyInfo')->middleware('PermissionCheck:company_settings_update');
    Route::get('location-api',                    [CompanyConfigController::class, 'locationApi'])->name('company.settings.locationApi')->middleware('PermissionCheck:locationApi');
    Route::post('update-api',                     [CompanyConfigController::class, 'updateApi'])->name('company.settings.updateApi')->middleware('PermissionCheck:locationApi');

    Route::get('activation',[CompanyConfigController::class, 'activation'])->name('company.settings.activation')->middleware('PermissionCheck:activation_read');
    Route::get('configuration',[CompanyConfigController::class, 'configuration'])->name('company.settings.configuration')->middleware('PermissionCheck:configuration_read');
    Route::match(['get','post'],'brandings',[CompanyConfigController::class, 'brandings'])->name('company.settings.brandings')->middleware('PermissionCheck:branding_update');

    // Module activation
    Route::get('addon/activation', [CompanyConfigController::class, 'addonActivation'])->name('company.settings.addon.activation')->middleware('PermissionCheck:activation_read');
    Route::post('addon/update', [CompanyConfigController::class, 'addonStatusUpdate'])->name('company.settings.addon.status.update')->middleware('PermissionCheck:configuration_update');
});
