<?php

use App\Models\User;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\Facades\Notification;
use Wave\Notifications\VerifyEmail;

Route::impersonate();

Route::get('/', '\Wave\Http\Controllers\HomeController@index')->name('wave.home');
Route::get('@{username}', '\Wave\Http\Controllers\ProfileController@index')->name('wave.profile');

// Documentation routes
Route::view('docs/{page?}', 'docs::index')->where('page', '(.*)');

// Additional Auth Routes
Route::get('logout', '\Wave\Http\Controllers\Auth\LoginController@logout')->name('wave.logout');
Route::get('cms/login', '\Wave\Http\Controllers\Auth\LoginController@showAdminLoginForm')->name('admin-login');
Route::get('user/verify/{verification_code}', '\Wave\Http\Controllers\Auth\RegisterController@verify')->name('verify');
Route::post('register/complete', '\Wave\Http\Controllers\Auth\RegisterController@complete')->name('wave.register-complete');
Route::post('registerAjax', '\Wave\Http\Controllers\Auth\RegisterController@registerAjax')->name('wave.register-ajax');

Route::get('blog', '\Wave\Http\Controllers\BlogController@index')->name('wave.blog');
Route::get('blog/{category}', '\Wave\Http\Controllers\BlogController@category')->name('wave.blog.category');
Route::get('blog/{category}/{post}', '\Wave\Http\Controllers\BlogController@post')->name('wave.blog.post');

Route::view('install', 'wave::install')->name('wave.install');

/***** Pages *****/
Route::get('p/{page}', '\Wave\Http\Controllers\PageController@page');

/***** Pricing Page *****/
Route::view('pricing', 'theme::pricing')->name('wave.pricing');

/***** Billing Routes *****/
Route::post('paddle/webhook', '\Wave\Http\Controllers\SubscriptionController@webhook');
Route::post('checkout', '\Wave\Http\Controllers\SubscriptionController@checkout')->name('checkout');

Route::get('test', '\Wave\Http\Controllers\SubscriptionController@test');


/**********/
Route::get('terms-and-conditions', '\Wave\Http\Controllers\Auth\LoginController@termsAndConditions')->name('user-terms-and-conditions');
Route::get('privacy-policy', '\Wave\Http\Controllers\Auth\LoginController@privacyPolicy')->name('user-privacy-policy');
Route::get('forgot-password', '\Wave\Http\Controllers\Auth\ForgotPasswordController@showRequestForm')->name('forgot-password');
Route::post('forgot-password/send-otp', '\Wave\Http\Controllers\Auth\ForgotPasswordController@sendOtp')->name('forgot-password.send-otp');
Route::post('forgot-password/submit-otp', '\Wave\Http\Controllers\Auth\ForgotPasswordController@submitOtp')->name('forgot-password.submit-otp');
Route::post('forgot-password/reset-password', '\Wave\Http\Controllers\Auth\ForgotPasswordController@resetPassword')->name('forgot-password.reset-password');

// Admin Dashboard
Route::group(['middleware' => ['wave', 'admin', 'route.access'], 'prefix' => 'cms'], function () {
	Route::get('/dashboard', '\Wave\Http\Controllers\CMS\DashboardController@index')->name('cms.dashboard');
	Route::get('/company-secretary', '\Wave\Http\Controllers\CMS\DashboardController@company_secretary')->name('cms.company-secretary');
	Route::get('/get-notifications', '\Wave\Http\Controllers\CMS\DashboardController@getNotifications')->name('cms.get-notifications');

	Route::group(['prefix' => 'users'], function () {
		Route::get('/', '\Wave\Http\Controllers\CMS\UserController@index')->name('cms.users');
		Route::post('/table', '\Wave\Http\Controllers\CMS\UserController@table')->name('cms.users.table');
		Route::post('/accessLogsTable/{userId?}', '\Wave\Http\Controllers\CMS\UserController@accessLogsTable')->name('cms.users.accessLogsTable');
		Route::post('/store', '\Wave\Http\Controllers\CMS\UserController@store')->name('cms.users.store');
		Route::post('/{user}/suspend', '\Wave\Http\Controllers\CMS\UserController@suspend')->name('cms.users.suspend');
		Route::post('/{user}/activate', '\Wave\Http\Controllers\CMS\UserController@activate')->name('cms.users.activate');
		Route::post('/{user}/destroy', '\Wave\Http\Controllers\CMS\UserController@destroy')->name('cms.users.destroy');
		Route::post('/{user}/show', '\Wave\Http\Controllers\CMS\UserController@show')->name('cms.users.show');
		Route::post('/{user}/update', '\Wave\Http\Controllers\CMS\UserController@update')->name('cms.users.update');
	});
	Route::group(['prefix' => 'crm'], function () {
		Route::get('/', '\Wave\Http\Controllers\CMS\CrmController@index')->name('cms.crm');
		Route::post('/table', '\Wave\Http\Controllers\CMS\CrmController@table')->name('cms.crm.table');
	});
	Route::group(['prefix' => 'companies'], function () {
		Route::get('/', '\Wave\Http\Controllers\CMS\CompanyController@index')->name('cms.companies');
		Route::post('/table', '\Wave\Http\Controllers\CMS\CompanyController@table')->name('cms.companies.table');
		Route::group(['prefix' => 'show/{company}'], function () {
			Route::get('/', '\Wave\Http\Controllers\CMS\CompanyController@show')->name('cms.companies.show');
			Route::post('/users-table', '\Wave\Http\Controllers\CMS\CompanyController@usersTable')->name('cms.companies.show.users-table');
			Route::post('/access-logs-table', '\Wave\Http\Controllers\CMS\CompanyController@accessLogsTable')->name('cms.companies.show.access-logs-table');
			Route::post('/update-xero-api', '\Wave\Http\Controllers\CMS\CompanyController@updateXeroApi')->name('cms.companies.show.update-xero-api');
			Route::post('/send-user-invite', '\Wave\Http\Controllers\CMS\CompanyController@sendUserInvite')->name('cms.companies.show.send-user-invite');
		});
	});
	Route::group(['prefix' => 'terms-and-conditions'], function () {
		Route::get('/', '\Wave\Http\Controllers\CMS\TermsAndConditionsController@index')->name('cms.terms-and-conditions');
		Route::post('/update', '\Wave\Http\Controllers\CMS\TermsAndConditionsController@update')->name('cms.terms-and-conditions.update');
	});
	Route::group(['prefix' => 'privacy-policy'], function () {
		Route::get('/', '\Wave\Http\Controllers\CMS\PrivacyPolicyController@index')->name('cms.privacy-policy');
		Route::post('/update', '\Wave\Http\Controllers\CMS\PrivacyPolicyController@update')->name('cms.privacy-policy.update');
	});
	Route::group(['prefix' => 'settings'], function () {
		Route::get('/', '\Wave\Http\Controllers\CMS\SettingController@index')->name('cms.settings');
		Route::post('/update-contact-us', '\Wave\Http\Controllers\CMS\SettingController@updateContactUs')->name('cms.settings.update-contact-us');
		Route::post('/update-password', '\Wave\Http\Controllers\CMS\SettingController@updatePassword')->name('cms.settings.update-password');
		Route::post('/table-online-help', '\Wave\Http\Controllers\CMS\SettingController@tableOnlineHelp')->name('cms.settings.table-online-help');
		Route::post('/store-online-help', '\Wave\Http\Controllers\CMS\SettingController@storeOnlineHelp')->name('cms.settings.store-online-help');
		Route::post('/{onlineHelp}/update-online-help', '\Wave\Http\Controllers\CMS\SettingController@updateOnlineHelp')->name('cms.settings.update-online-help');
		Route::post('/{onlineHelp}/destroy-online-help', '\Wave\Http\Controllers\CMS\SettingController@destroyOnlineHelp')->name('cms.settings.destroy-online-help');
		Route::post('/update-notification-settings', '\Wave\Http\Controllers\CMS\SettingController@updateNotificationSettings')->name('cms.settings.update-notification-settings');
		Route::post('/update-api-key', '\Wave\Http\Controllers\CMS\SettingController@updateApiKey')->name('cms.settings.update-api-key');
	});
	Route::group(['prefix' => 'enquiry'], function () {
		Route::get('/', '\Wave\Http\Controllers\CMS\EnquiryController@index')->name('cms.enquiries');
		Route::post('/{enquiry}/show', '\Wave\Http\Controllers\CMS\EnquiryController@show')->name('cms.enquiries.show');
		Route::post('/{enquiry}/update-reply', '\Wave\Http\Controllers\CMS\EnquiryController@updateReply')->name('cms.enquiries.update-reply');
	});
	Route::group(['prefix' => 'chat'], function () {
		Route::get('/', '\Wave\Http\Controllers\CMS\ChatController@index')->name('cms.chat');
		Route::get('/get-chats', '\Wave\Http\Controllers\CMS\ChatController@getChats')->name('cms.chat.get-chats');
		Route::post('/get-topics', '\Wave\Http\Controllers\CMS\ChatController@getTopics')->name('cms.chat.get-topics');
		Route::get('/get-messages/{serviceChat}', '\Wave\Http\Controllers\CMS\ChatController@getMessages')->name('cms.chat.get-messages');
		Route::post('/send-message/{serviceChat}', '\Wave\Http\Controllers\CMS\ChatController@sendMessage')->name('cms.chat.send-message');
	});
	Route::group(['prefix' => 'security'], function () {
		Route::get('/', '\Wave\Http\Controllers\CMS\SecurityController@index')->name('cms.securities');
		Route::post('/table', '\Wave\Http\Controllers\CMS\SecurityController@groupListTable')->name('cms.securities.groupListTable');
		Route::post('/{role}/suspend', '\Wave\Http\Controllers\CMS\SecurityController@suspend')->name('cms.securities.suspend');
		Route::post('/{role}/activate', '\Wave\Http\Controllers\CMS\SecurityController@activate')->name('cms.securities.activate');
		Route::post('/update-role-permissions', '\Wave\Http\Controllers\CMS\SecurityController@updateRolePermission')->name('cms.securities.updateRolePermission');
	});
	Route::group(['prefix' => 'subscriptions'], function () {
		Route::get('/', '\Wave\Http\Controllers\CMS\SubscriptionController@index')->name('cms.subscriptions');
		Route::post('/table/{status?}', '\Wave\Http\Controllers\CMS\SubscriptionController@table')->name('cms.subscriptions.table');
		Route::get('/get-subscriptions/{service_type}', '\Wave\Http\Controllers\CMS\SubscriptionController@getSubscriptions')->name('cms.subscriptions.get-subscriptions');
		Route::group(['prefix' => 'management'], function () {
			Route::get('/', '\Wave\Http\Controllers\CMS\SubscriptionManagementController@index')->name('cms.subscriptions.management');
			Route::post('/table/{service_type}', '\Wave\Http\Controllers\CMS\SubscriptionManagementController@table')->name('cms.subscriptions.management.table');
			Route::post('/{subscription}/suspend', '\Wave\Http\Controllers\CMS\SubscriptionManagementController@suspend')->name('cms.subscriptions.management.suspend');
			Route::post('/{subscription}/activate', '\Wave\Http\Controllers\CMS\SubscriptionManagementController@activate')->name('cms.subscriptions.management.activate');
			Route::get('/create/{service_type}', '\Wave\Http\Controllers\CMS\SubscriptionManagementController@create')->name('cms.subscriptions.management.create');
			Route::post('/store', '\Wave\Http\Controllers\CMS\SubscriptionManagementController@store')->name('cms.subscriptions.management.store');
			Route::get('/edit/{subscription}', '\Wave\Http\Controllers\CMS\SubscriptionManagementController@edit')->name('cms.subscriptions.management.edit');
			Route::post('/update/{subscription}', '\Wave\Http\Controllers\CMS\SubscriptionManagementController@update')->name('cms.subscriptions.management.update');
		});
	});
	Route::group(['prefix' => 'bookkeepings'], function () {
		Route::get('/', '\Wave\Http\Controllers\CMS\BookkeepingController@index')->name('cms.bookkeepings');
		Route::get('/get-companies', '\Wave\Http\Controllers\CMS\BookkeepingController@getCompanies')->name('cms.bookkeepings.get-companies');
		Route::get('/get-categories', '\Wave\Http\Controllers\CMS\BookkeepingController@getCategories')->name('cms.bookkeepings.get-categories');
		Route::post('/table/{isCompleted?}', '\Wave\Http\Controllers\CMS\BookkeepingController@table')->name('cms.bookkeepings.table');
		Route::post('/update-status', '\Wave\Http\Controllers\CMS\BookkeepingController@updateStatus')->name('cms.bookkeepings.update-status');
		Route::post('/action-logs-table', '\Wave\Http\Controllers\CMS\BookkeepingController@actionLogsTable')->name('cms.bookkeepings.action-logs-table');
		Route::post('/re-upload-file', '\Wave\Http\Controllers\CMS\BookkeepingController@reUploadFile')->name('cms.bookkeepings.re-upload-file');
		Route::group(['prefix' => 'categories'], function () {
			Route::get('/', '\Wave\Http\Controllers\CMS\BookkeepingCategoryController@index')->name('cms.bookkeepings.categories');
			Route::post('/table', '\Wave\Http\Controllers\CMS\BookkeepingCategoryController@table')->name('cms.bookkeepings.categories.table');
			Route::post('/store', '\Wave\Http\Controllers\CMS\BookkeepingCategoryController@store')->name('cms.bookkeepings.categories.store');
			Route::post('/{category}/destroy', '\Wave\Http\Controllers\CMS\BookkeepingCategoryController@destroy')->name('cms.bookkeepings.categories.destroy');
			Route::post('/{category}/show', '\Wave\Http\Controllers\CMS\BookkeepingCategoryController@show')->name('cms.bookkeepings.categories.show');
			Route::post('/{category}/update', '\Wave\Http\Controllers\CMS\BookkeepingCategoryController@update')->name('cms.bookkeepings.categories.update');
		});
		Route::group(['prefix' => 'document-libraries'], function () {
			Route::get('/', '\Wave\Http\Controllers\CMS\BookkeepingDocumentLibraryController@index')->name('cms.bookkeepings.document-libraries');
			Route::post('/table', '\Wave\Http\Controllers\CMS\BookkeepingDocumentLibraryController@table')->name('cms.bookkeepings.document-libraries.table');
			Route::post('/store', '\Wave\Http\Controllers\CMS\BookkeepingDocumentLibraryController@store')->name('cms.bookkeepings.document-libraries.store');
			Route::get('/export', '\Wave\Http\Controllers\CMS\BookkeepingDocumentLibraryController@export')->name('cms.bookkeepings.document-libraries.export');
			Route::get('/{document}/download', '\Wave\Http\Controllers\CMS\BookkeepingDocumentLibraryController@download')->name('cms.bookkeepings.document-libraries.download');
		});
	});
	// Change active company
	Route::get('/change-active-company/{company_id}', function ($company_id) {
		auth()->user()->update([
            'admin_active_company_id' => $company_id,
        ]);

		return redirect()->back();
	})->name('cms.change-active-company');
});

Route::group(['middleware' => 'auth'], function(){
	Route::get('settings/{section?}', '\Wave\Http\Controllers\SettingsController@index')->name('wave.settings');

	Route::post('settings/profile', '\Wave\Http\Controllers\SettingsController@profilePut')->name('wave.settings.profile.put');
	Route::put('settings/security', '\Wave\Http\Controllers\SettingsController@securityPut')->name('wave.settings.security.put');

	Route::post('settings/api', '\Wave\Http\Controllers\SettingsController@apiPost')->name('wave.settings.api.post');
	Route::put('settings/api/{id?}', '\Wave\Http\Controllers\SettingsController@apiPut')->name('wave.settings.api.put');
	Route::delete('settings/api/{id?}', '\Wave\Http\Controllers\SettingsController@apiDelete')->name('wave.settings.api.delete');

	Route::get('settings/invoices/{invoice}', '\Wave\Http\Controllers\SettingsController@invoice')->name('wave.invoice');

	Route::get('notifications', '\Wave\Http\Controllers\NotificationController@index')->name('wave.notifications');
	Route::get('announcements', '\Wave\Http\Controllers\AnnouncementController@index')->name('wave.announcements');
	Route::get('announcement/{id}', '\Wave\Http\Controllers\AnnouncementController@announcement')->name('wave.announcement');
	Route::post('announcements/read', '\Wave\Http\Controllers\AnnouncementController@read')->name('wave.announcements.read');
	Route::get('notifications', '\Wave\Http\Controllers\NotificationController@index')->name('wave.notifications');
	Route::post('notification/read/{id}', '\Wave\Http\Controllers\NotificationController@delete')->name('wave.notification.read');

    /********** Checkout/Billing Routes ***********/
    Route::post('cancel', '\Wave\Http\Controllers\SubscriptionController@cancel')->name('wave.cancel');
    Route::view('checkout/welcome', 'theme::welcome');

    Route::post('subscribe', '\Wave\Http\Controllers\SubscriptionController@subscribe')->name('wave.subscribe');
	Route::view('trial_over', 'theme::trial_over')->name('wave.trial_over');
	Route::view('cancelled', 'theme::cancelled')->name('wave.cancelled');
    Route::post('switch-plans', '\Wave\Http\Controllers\SubscriptionController@switchPlans')->name('wave.switch-plans');
});
Route::group(['middleware' => 'admin.user'], function(){
    Route::view('admin/do', 'wave::do');
});

// User Dashboard
Route::group(['middleware' => 'user'], function(){
	Route::group(['middleware' => 'auth', 'prefix' => 'dashboard'], function(){
		Route::post('/send-chat', '\Wave\Http\Controllers\User\DashboardController@sendChat')->name('wave.user.dashboard.sendChat');
		Route::get('/get-chat-messages/{serviceType}', '\Wave\Http\Controllers\User\DashboardController@getChatMessages')->name('wave.user.dashboard.getChatMessages');
	});
	Route::group(['middleware' => 'auth', 'prefix' => 'user'], function(){
		Route::get('/dashboard', '\Wave\Http\Controllers\User\DashboardController@index')->name('wave.user.dashboard');
		Route::get('/privacy-policy', '\Wave\Http\Controllers\User\DashboardController@userPrivacyPolicy')->name('wave.user.privacy-policy');
		Route::get('/terms-and-condition', '\Wave\Http\Controllers\User\DashboardController@userTermsAndCondition')->name('wave.user.terms-and-condition');
	});

	//user management
	Route::group(['middleware' => 'auth', 'prefix' => 'management'], function(){
		Route::post('/create/user', '\Wave\Http\Controllers\User\DashboardController@createUser')->name('wave.management.create.user');
		Route::post('/update/user', '\Wave\Http\Controllers\User\DashboardController@updateUser')->name('wave.management.update.user');
		Route::post('/delete/user', '\Wave\Http\Controllers\User\DashboardController@deleteUser')->name('wave.management.delete.user');
	});
});

// User static pages
Route::get('user/general-information', '\Wave\Http\Controllers\User\DashboardController@generalInformation')->name('wave.user.general-information');
Route::get('user/user-management', '\Wave\Http\Controllers\User\DashboardController@userManagement')->name('wave.user.user-management');
Route::post('user/role/add-permission', '\Wave\Http\Controllers\User\DashboardController@addPermissionToRole')->name('user.role.add-permission');
Route::post('user/role/remove-permission', '\Wave\Http\Controllers\User\DashboardController@removePermissionToRole')->name('user.role.remove-permission');
// Book Keeping pages
Route::get('user/book-keeping/account-overview', '\Wave\Http\Controllers\User\BookKeepingController@accountOverview')->name('wave.user.book-keeping.account-overview');
Route::get('user/book-keeping/list', '\Wave\Http\Controllers\User\BookKeepingController@list')->name('wave.user.book-keeping.list');
Route::post('user/book-keeping/add/document', '\Wave\Http\Controllers\User\BookKeepingController@addBookkeepingDocument')->name('wave.user.book-keeping.add.document');
Route::get('user/book-keeping/document-library', '\Wave\Http\Controllers\User\BookKeepingController@documentLibrary')->name('wave.user.book-keeping.document-library');
Route::get('user/book-keeping/packages', '\Wave\Http\Controllers\User\BookKeepingController@packages')->name('wave.user.book-keeping.packages');
Route::get('user/book-keeping/checkout/{package_id}', '\Wave\Http\Controllers\User\BookKeepingController@checkout')->name('wave.user.book-keeping.checkout');
Route::get('user/book-keeping/checkout-payment-success', '\Wave\Http\Controllers\User\BookKeepingController@checkoutPaymentSuccess')->name('wave.user.book-keeping.checkout-payment-success');
Route::get('user/book-keeping/download/document/{document_id}', '\Wave\Http\Controllers\User\BookKeepingController@downloadDocument')->name('wave.user.book-keeping.donwload.document');
// Company Secretary service pages
Route::get('user/company-secretary', '\Wave\Http\Controllers\User\CompanySecretaryController@index')->name('wave.user.company-secretary.index');
Route::get('user/company-secretary/limited-company', '\Wave\Http\Controllers\User\CompanySecretaryController@limitedCompany')->name('wave.user.company-secretary.limited-company');
Route::get('user/company-secretary/change-director', '\Wave\Http\Controllers\User\CompanySecretaryController@changeDirector')->name('wave.user.company-secretary.change-director');
Route::get('user/company-secretary/change-secretary', '\Wave\Http\Controllers\User\CompanySecretaryController@changeSecretary')->name('wave.user.company-secretary.change-secretary');
Route::get('user/company-secretary/change-particulars', '\Wave\Http\Controllers\User\CompanySecretaryController@changeParticulars')->name('wave.user.company-secretary.change-particulars');
Route::get('user/company-secretary/resignation', '\Wave\Http\Controllers\User\CompanySecretaryController@resignation')->name('wave.user.company-secretary.resignation');
Route::get('user/company-secretary/checkout', '\Wave\Http\Controllers\User\CompanySecretaryController@checkout')->name('wave.user.company-secretary.checkout');
Route::get('user/company-secretary/checkout-payment-success', '\Wave\Http\Controllers\User\CompanySecretaryController@checkoutPaymentSuccess')->name('wave.user.company-secretary.checkout-payment-success');
Route::get('user/company-secretary/checkout-payment-failed', '\Wave\Http\Controllers\User\CompanySecretaryController@checkoutPaymentFailed')->name('wave.user.company-secretary.checkout-payment-failed');

// Company Secretary static pages
Route::get('company-secretary/service-list', '\Wave\Http\Controllers\CompanySecretary\ServiceRecordController@serviceList')->name('records-service-list');


// Company Secretary payment flow pages
Route::get('user/payment-flow', '\Wave\Http\Controllers\User\PaymentFlowController@index')->name('wave.user.payment-flow.index');
Route::get('user/payment-flow/cart-summary', '\Wave\Http\Controllers\User\PaymentFlowController@cartSummary')->name('wave.user.payment-flow.cart-summary');
Route::get('user/payment-flow/payment-success', '\Wave\Http\Controllers\User\PaymentFlowController@paymentSuccess')->name('wave.user.payment-flow.payment-success');
Route::get('company-secretary/document-library', '\Wave\Http\Controllers\CompanySecretary\ServiceRecordController@documentLibrary')->name('records-document-library');
Route::get('company-secretary/digital-transformation', '\Wave\Http\Controllers\CompanySecretary\ServiceRecordController@digitalTransformation')->name('records-digital-transformation');
Route::get('company-secretary/service-draft', '\Wave\Http\Controllers\CompanySecretary\ServiceRecordController@serviceDraft')->name('records-service-draft');
Route::get('company-secretary/change-company-name', '\Wave\Http\Controllers\CompanySecretary\CompanyController@changeCompanyName')->name('records-change-company-name');
Route::get('company-secretary/change-company-address', '\Wave\Http\Controllers\CompanySecretary\CompanyController@changeCompanyAddress')->name('records-change-company-address');
Route::get('company-secretary/transfer-of-shares', '\Wave\Http\Controllers\CompanySecretary\CompanyController@transferOfShares')->name('records-transfer-of-shares');
Route::get('company-secretary/service-enquiry', '\Wave\Http\Controllers\CompanySecretary\CompanyController@serviceEnquiry')->name('records-service-enquiry');
Route::get('company-secretary/enquiry-history', '\Wave\Http\Controllers\CompanySecretary\CompanyController@enquiryHistory')->name('records-enquiry-history');
Route::get('company-secretary/enquiry-details', '\Wave\Http\Controllers\CompanySecretary\CompanyController@enquiryDetails')->name('records-enquiry-details');

// UW 107 - Account
Route::get('account/my-account', '\Wave\Http\Controllers\Account\AccountController@myAccount')->name('account-my-account');

// UW 108 - Settings
Route::get('setting/main', '\Wave\Http\Controllers\Settings\SettingsController@main')->name('settings-main');
Route::get('setting/enquiries', '\Wave\Http\Controllers\Settings\SettingsController@myEnquiries')->name('settings-my-enquiries');
Route::get('setting/enquiry-details', '\Wave\Http\Controllers\Settings\SettingsController@enquiryDetails')->name('settings-enquiry-details');
Route::group(['middleware' => 'auth', 'prefix' => 'setting', 'as' => 'settings.'], function(){
	Route::get('/update/notification/status/{notification}', '\Wave\Http\Controllers\Settings\SettingsController@toggleNotificationStatus')->name('update.notification.status');
	Route::post('/update/password', '\Wave\Http\Controllers\Settings\SettingsController@changePassword')->name('update.password');
	Route::post('/submit/enquiry', '\Wave\Http\Controllers\Settings\SettingsController@addEnquiry')->name('submit.enquiry');
});

// Change language
Route::get('language/{locale}', function ($locale) {
    app()->setLocale($locale);
    session()->put('locale', $locale);
    return redirect()->back();
})->name('language');

// Test Routes
Route::get('test/send-verify-email/{email}', function ($email) {
	$user = User::find(1);
	Notification::route('mail', $email)->notify(new VerifyEmail($user));
});

Route::prefix('v1/api')->group(base_path('wave/routes/numstation.php'));

Route::group(['middleware' => 'auth', 'prefix' => 'company', 'as' => 'company.'], function(){
	Route::post('/update/details', '\Wave\Http\Controllers\User\GeneralInformationController@saveCompanyDetails')->name('update.details');
	Route::post('/add/members', '\Wave\Http\Controllers\User\GeneralInformationController@updateCompanyMember')->name('add.member');
	Route::post('/delete/member/file', '\Wave\Http\Controllers\User\GeneralInformationController@deleteMemberDocument')->name('delete.member.file');
});