<?php

use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| Viartas Admin Theme Routes
|--------------------------------------------------------------------------
|
| These routes are loaded by the ThemeServiceProvider and are assigned
| the "web" middleware group. Customize as needed.
|
*/

Route::middleware(['web', 'auth'])->prefix('admin')->name('viartas.')->group(function () {
    
    // Dashboard
    Route::get('/', function () {
        return view('viartas::accounting.dashboard');
    })->name('dashboard');

    // Analytics
    Route::get('/analytics', function () {
        return view('viartas::accounting.analytics');
    })->name('analytics');

    // Accounting Module
    Route::prefix('accounting')->name('accounting.')->group(function () {
        Route::get('/invoices', function () {
            return view('viartas::accounting.invoices');
        })->name('invoices');

        Route::get('/expenses', function () {
            return view('viartas::accounting.expenses');
        })->name('expenses');

        Route::get('/reports', function () {
            return view('viartas::accounting.reports');
        })->name('reports');
    });

    // Users Module
    Route::prefix('users')->name('users.')->group(function () {
        Route::get('/', function () {
            return view('viartas::accounting.users.index');
        })->name('index');

        Route::get('/roles', function () {
            return view('viartas::accounting.users.roles');
        })->name('roles');

        Route::get('/permissions', function () {
            return view('viartas::accounting.users.permissions');
        })->name('permissions');
    });

    // Settings
    Route::get('/settings', function () {
        return view('viartas::accounting.settings');
    })->name('settings');
});
